find( { ... } , { "reps.voters" : 0 } )
Probably similar in c#
On Fri, May 13, 2011 at 2:15 AM, Projapati <mohamm...@gmail.com> wrote:
> I have this document. I want to read _id, date,user, reps fields from
> top collection.
> But I don't want to read voters list from the embedded reps document
>
> How do I read this in mongodb-csharp driver?
>
> cursor.SetFields("_id", "user", "date", "reps"); <-- how to exclude
> reps.voters?
> List<Comment> cmts = cur.ToList();
>
>
> { "_id" : ObjectId("abcd"),
> "date" : ISODate("2011-05-09T02:56:40.526Z"),
> "user" : "bob",
> "reps" : [
> {
> "_id" : ObjectId("abcdef"),
> "user" : "guru",
> "text" : "We will be there"
> },
> {
> "_id" : ObjectId("4dcb8079602fdd0c24927831"),
> "likes" : 1,
> "text" : "This is second reply.",
> "user" : "guru",
> "voters" : [ <-- don't want to read this
> "papon"
> ]
> }]
> }
>
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>