Rick

I have the following collection based on your first note:


{
  "_id" : ObjectId("5253b7f31302e3210b53f9e1"),
  "authour" : "Cool Author",
  "chapter" : [{
      "chapterid" : 1,
      "sections" : [ ],
      "title" : "Chap A"
    }, {
      "chapterid" : 2,
      "sections" : [ ],
      "title" : "Chap B"
    }],
  "title" : "My Book"
}


And running this query :

db.arrayTest.find(
    {'chapter.chapterid' : 1 },
    {'chapter' : { $elemMatch : { 'chapterid' : 1 } } }
)


returns me

{
  "_id" : ObjectId("5253b7f31302e3210b53f9e1"),
  "chapter" : [{
      "chapterid" : 1,
      "sections" : [ ],
      "title" : "Chap A"
    }]
}


Is this what you where looking for?


Rick <mailto:[email protected]>
08 October 2013 04:56

Any insight would be helpful. Don't know of any other resources to ask. The capability does exist in mongodb from many approaches but it's not working for me through openbd.

Anyone?
--
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en

---
You received this message because you are subscribed to the Google Groups "Open BlueDragon" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
Rick <mailto:[email protected]>
07 October 2013 04:07
I'm using the latest mongodb and openbd.

However, while I can query and get back the entire BOOK data, I cannot seem to limit the query to only get back 1 chapter at a time. I am absolute that mongodb supports it but when I try the examples from the mongodb site to access the array to only return a chapter, it will not return it alone. I've gone through all of the ways that mongodb's docs says that the array can be accessed.

I've tried to see if there was a new mongodb jar available to update openbd and I see that the latest openbd is using the latest mongodb jar.

Stuck!

---------------------------------------------------------------------------------------------
*chapters* = [
{chapterid = 1, title = "Chap A", sections = []},
{chapterid = 2, title = "Chap B", sections = []},
{chapterid = 3, title = "Chap C", sections = [
{chapterid = 4, title = "Chap C1"},
{chapterid = 5, title = "Chap C2"}
]}
];

book = {
        title = "My Book",
        author = "Cool Author",
        chapters = *chapters*
 };
---------------------------------------------------------------------------------------------


--
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en

---
You received this message because you are subscribed to the Google Groups "Open BlueDragon" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

--
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en

--- You received this message because you are subscribed to the Google Groups "Open BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to