Add Unique only to array and keep field count on update
问题 I store in a collection an array of item (stringId). All element in this array must be unique. So I use $addToSet to push my item. But, I also would like to set in the same request the size of my array in a field : { unique_array: ['12', '20', '18'], size_of_array: 3 } => Add to set 15 { unique_array: ['12', '20', '18', '15'], => Add to set size_of_array: 4 => Incremented } => Add to set 18 { unique_array: ['12', '20', '18', '15'], => Already in the set size_of_array: 4 => Not incremented }