-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
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.