Re: adding multible objects parts to bson array

From: Andrew Morrow <andrew.morrow@xxxxxxxxxxx>
To: "mongodb-user@xxxxxxxxxxxxxxxx" <mongodb-user@xxxxxxxxxxxxxxxx>
Date: Fri, 15 Apr 2016 13:29:10 -0400
Why ads?
Hi -

What driver or API are you trying to use to accomplish this?

Thanks
Andrew


On Sat, Apr 9, 2016 at 10:31 AM, javantamt <javantamt@xxxxxxxxx> wrote:

Hey there!
there is a JSON file in a BSON Object looking like the following.
I'm going to add in the marked areas the same attribut. I'm having
problems in my loops to get the number of elements from a array. so I can't
navigate in it. Only possible way I see is to iterate through every single
element of the array and check if the returned value is 0x00 or valid.
Is there a possebilety to get the number of elements in the array?

Any help would be awesome!

thx!

{
    "_id" : ObjectId("5705918cb6a7d12aea0525f1"),
//add: "status" : 0
    "targets" : {
        "fast" : [
            {
                "size" : "poster",
                "format" : "jpg",
                "count" : 5
        //add: "status" : 0
            },
            {
                "size" : "thumb",
                "format" : "jpg"
        //add: "status" : 0
            }
            // more fields of the array could follow here...
        ],
        "slow" : [
            {
                "size" : "sd",
                "format" : "mp4"
        //add: "status" : 0
            },
            {
                "size" : "sd",
                "format" : "webm"
        //add: "status" : 0
            }
            // more fields of the array could follow here...
        ]
}}


--
You received this message because you are subscribed to the Google Groups
"mongodb-user"
group.

For other MongoDB technical support options, see:
https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit
https://groups.google.com/d/msgid/mongodb-user/63de780c-6004-4879-a517-75839848cbe5%40googlegroups.com
<https://groups.google.com/d/msgid/mongodb-user/63de780c-6004-4879-a517-75839848cbe5%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAHX05qEfP64SLL6jiCHcDo0p3zS9XbaqiF3R73xVbXjniMFxDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?