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

ensureIndex not working with Java driver.

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Documentation
    • Windows 7

    Description

      Hi, I am trying to use ensureIndex for my collection using Java Driver of MongoDB. I want to have an unique index to be placed on my collection. I have used usercollection.ensureIndex(new BasicDBObject("id", 1).append("unique", true));. Please help me with the correct code to be used.

      Attachments

        Activity

          People

            Unassigned Unassigned
            prudhvi70 prudhvi chaganti
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: