Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-871

:pk is mentioned, but not supported

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 12_01_17
    • Affects Version/s: 1.12
    • Component/s: Public API
    • None

      From the documentation linked from the Mongo web site, this should work:

      class PKFactory
      def create_pk(doc)
      return doc if doc[:_id] or doc['_id']
      doc[:_id] ||= SecureRandom::uuid()
      doc
      end
      end

      db = Mongo::MongoClient.from_uri(uri).db(database, pk: PKFactory.new)

      However, it does not.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            skandragon Michael Graff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: