marlor
unread,Jan 19, 2011, 6:39:50 PM1/19/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Morphia
hi,
i have the following structure.
{"itemId" : "item111",
"lines" : [
{ "lineId" : "line111", "status" : { "statustype" : "AAA"} },
{ "lineId" : "line222", "status" : { "statustype" : "BBB"} }
]
}
{"itemId" : "item222",
"lines" : [
{ "lineId" : "line333", "status" : { "statustype" : "AAA"} },
{ "lineId" : "line444", "status" : { "statustype" : "AAA"} }
]
}
{"itemId" : "item333",
"lines" : [
{ "lineId" : "line555", "status" : { "statustype" : "CCC"} },
{ "lineId" : "line666", "status" : { "statustype" : "CCC"} }
]
}
How can I query all items which do not have all of its
lines.status.statustype AAA.
In case of statustype AAA, with the above sample, I want to retrieve
item with itemId item111 and item333. NOT item222 as both of it's
statustype is AAA.
Note: there can be more than two lines per item.
I tried the different query methods notEquals, hasNonOf ... but it
looks like they are not the implementation i am looking for as in this
case i am searching for fields within an array "lines".
any suggestions?
thank you,
marlor