Dear All,
i've probles to make queries when the data tipe is complex
{
"_id" : "DC396F11E04B",
"events" : {
"0 BOOTSTRAP" : true
},
"precondition" : "VirtualParameters.SerialNumber = \"DC396F11E04B\"",
"weight" : NumberInt(0),
"configuratio10.0.0.0.1 192.168.1.254 happymod
{
"type" : "provision",
"name" : "DC396F11E04B",
"args" : null
}
]
}
in this case when i use the find command i've invalid array error
how i can fix it?
MongoDB Query Error - Invalid Array!!
-
- Posts: 4
- Joined: Wed 08 Apr 2020 17:28
MongoDB Query Error - Invalid Array!!
Last edited by farukhcasy2 on Sat 09 May 2020 06:08, edited 1 time in total.
Re: MongoDB Query Error - Invalid Array!!
1. The element "weight" : NumberInt(0)
We don't support MongoDB number aliases https://docs.mongodb.com/manual/referen ... e-examples. Currently, we support the following BSON types https://docs.mongodb.com/manual/reference/bson-types/, that are represented in the Extended JSON format: https://docs.mongodb.com/manual/referen ... nded-json/ .
Thus, the element in the example should be written as "weight" : { "$numberInt": "0" }
2. "configurations" : [10.0.0.0.1 192.168.1.254 happymod
{
"type" : "provision",
"name" : "DC396F11E04B",
"args" : null
}
]
the above JSON array contains errors:
- if the first element of the array (10.0.0.0.1 192.168.1.254 happymod) is a string, it must be enclosed in double quotes;
- missing comma separator after the first element of the array.
See the JSON documentation for more information: https://www.json.org/json-en.html
We don't support MongoDB number aliases https://docs.mongodb.com/manual/referen ... e-examples. Currently, we support the following BSON types https://docs.mongodb.com/manual/reference/bson-types/, that are represented in the Extended JSON format: https://docs.mongodb.com/manual/referen ... nded-json/ .
Thus, the element in the example should be written as "weight" : { "$numberInt": "0" }
2. "configurations" : [10.0.0.0.1 192.168.1.254 happymod
{
"type" : "provision",
"name" : "DC396F11E04B",
"args" : null
}
]
the above JSON array contains errors:
- if the first element of the array (10.0.0.0.1 192.168.1.254 happymod) is a string, it must be enclosed in double quotes;
- missing comma separator after the first element of the array.
See the JSON documentation for more information: https://www.json.org/json-en.html
Re: MongoDB Query Error - Invalid Array!!
Thanks for the valuable advice, I have been looking for this information for a long time. 192.168.1.1
Re: MongoDB Query Error - Invalid Array!!
Thank you for the interest to our product.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.