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 -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -