[CSHARP-812] Nested object list and query nested columns,but doesn't match any value Created: 02/Sep/13 Updated: 05/Apr/19 Resolved: 20/Jun/14 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Setup |
| Affects Version/s: | 1.8.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | bivozeou | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | driver, query, question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
microsoft winodws , visual studio 2010 ,mongodb 2.4.3 |
||
| Attachments: |
|
| Description |
|
detail is here table Imb_MicroBlog
table Imb_Comment
when i want to match nested Imb_Comment's cloumns isAudit=true and Slice them
but it match all rows include isAudit=false, i don't how to query nested item ,hope help me thanks very much |
| Comments |
| Comment by Robert Stam [ 20/Mar/14 ] | |||||
|
Sorry for the delay in responding... are you still interested in pursuing this? If so, I'm still not exactly clear on what the question is. Can you provide some sample documents that you want to match the query and some that you don't want to match the query? Perhaps describe in words what you want the query to do and we can try to come up with a query that does that. Thanks! | |||||
| Comment by bivozeou [ 03/Sep/13 ] | |||||
|
Mongo Action 1: in this way , if one row matched all row matched C#:
in mongo shell cmd :
Mongo Action 2: in this way , just can matched no more than one row C#:
in mongo shell cmd :
please change the mongohelper connectionString to your mangodb address | |||||
| Comment by Robert Stam [ 02/Sep/13 ] | |||||
|
Have you tried to get this working the MongoDB shell? Sometimes it's useful to experiment in the shell and then translate to C#. One thing to consider is that when you query against an array element (i.e. { "commentList.isAudit" : true }) it will match a document where any of the entries in the commentList have isAudit set to true. Can you provide a sample document that you think should not be matched? |