#Create a unique field in mongodb

5 messages · Page 1 of 1 (latest)

dark scarab
#

what you are trying todo?

#

eate a unique field like _id but I can't find documentation about this thing,
no, i mean, what's up with UpdateOne?
link that i mentioned above, explain, how to create a unique index. which is the original question.
~
what's the relation, between unique index and UpdateOne ?

dark scarab
#

did you get any error message?

#

btw, i dont think you can set multiple fields in one $set statement.

{"$set", bson.D{{"pass", r.FromValue("password ")}}},
{"$set", bson.D{{"unique", mmmm}}}