Auto increment in MongoDB to store sequence of Unique User ID
问题 I am making a analytics system, the API call would provide a Unique User ID, but it\'s not in sequence and too sparse. I need to give each Unique User ID an auto increment id to mark a analytics datapoint in a bitarray/bitset. So the first user encounters would corresponding to the first bit of the bitarray, second user would be the second bit in the bitarray, etc. So is there a solid and fast way to generate incremental Unique User IDs in MongoDB? 回答1: You can, but you should not https://web