i want to get all values of a mongodb document from a single value.
Example:
"id": "id",
"name": "name",
"description": "description",
"invite": "invite",
"support_server": "server",
"developer": "developer",
"avatar": null
This is my object.
When i use .findOne() function of MongoDB, i want to get all values.
Example:
<collection>.findOne({"id":"id"})
//get all values name, description, invite ecc. from id
(i'm using node.js)
this is my current code:
socket.on("bot_req_id", function(data) {
let db = mongoose.db("wumpusCave")
let bots = db.collection("bots")
console.log(data)
let bot = bots.findOne({data})
console.log()
socket.emit("bot_res_id", bot)
})
How i can do this?
Thanks in advice and sorry for bad english!