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

Popular posts from this blog

resizing Telegram inline keyboard -

javascript - How to bind ViewModel Store to View? -

javascript - Solution fails to pass one test with large inputs? -