javascript - Is possible in mongodb to create a new document with a combination of random unique values -
i'm creating 2d map game , have generate fixed locations in database.
so, have collection called locations, contains documents format:
{ x: { type: number }, y: { type: number }, }
i want query creates new document random value in x , y. each document has unique, combination of x , y can't repeated.
is possible?
Comments
Post a Comment