Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-496

Driver does not support field negation

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • API
    • None

    Description

      Field negation is outlined in the mongo docs here: http://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields

      It is supported in the core of mongo but not in the Java Driver.

      For example:
      BasicDBObject fields = new BasicDBObject();
      fields.put("somebigfield", "0");

      DBCursor cur = collection.find(new BasicDBObject, fields);

      Will return the "somebigfield" rather than omitting it. It doesn't matter what value is given for the field value (0, 1, xxxx) the same thing is returned - ie. somebigfield and the id

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            damianharvey Damian Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: