Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9025

[suggestion] Expression for "_id" generation.

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Mongo has a interop mechanism between replica members that lets it generate unique _id easily. But when our application wants to create an _id that starts with user_id, it becomes much harder to keep uniqueness.

      I'd like to suggest to add a mechanism to be able to set an _id generation for collection as some sort of template that would look like (in my case with user_id upfront) "

      {id} {mongoid}

      ", that would put my id (which is just user_id) and then mongo-generated one. Possibly more parameters could be added to make it more flexible.

      What do you think?

            Assignee:
            Unassigned Unassigned
            Reporter:
            k-bx Kostyantyn Rybnikov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: