auto increment id
これを使用するための追加を試みsub-documents
ます:
db.users.update({"pup.avt.fto": var},{"$push":{"pup.$.cmn":{"txt": cmnt, {"id":{"$inc":1}}}}})
しかし、それはうまくいきません!
私は何を間違っていますか?
これが私が手に入れたものです(Fang of Mongoを使用)
ご覧のとおり、追加しid
てインクリメントしたい:
{
"adr": {
"wil": "15",
"com": "Azazga",
"sit": "http://peugeot.dz",
"cor": [
36.743954,
4.365041
]
},
"_id": "abdelouahab_al@yahoo.fr",
"pup": [
{
"avt": {
"fto": {
"$oid": "516ff3e03a5f3a0eec7c4e2b"
},
"ori": "portrait"
},
"cmn": [
{
"txt": "this is the comment that i want to add the increment id"
},
],
},
}