0

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"
 },
       ],
},
}
4

0 に答える 0