Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-1

Sequences would be better done by findandmodify

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      http://www.mongodb.org/display/DOCS/Object+IDs#ObjectIDs-SequenceNumbers links to http://www.mongodb.org/display/DOCS/Atomic+Operations (instead of http://www.mongodb.org/display/DOCS/Atomic+Operations#AtomicOperations-%22InsertifNotPresent%22 ) but that code is not the best concurrency-wise, findandmodify is way better for sequences

      we do:

      $cmd = array(
      'findandmodify' => mongodb_collection_name('sequence'),
      'query' => array('_id' => $name),
      'update' => array('$inc' => array('value' => 1)),
      'new' => TRUE,
      );

            Assignee:
            Unassigned Unassigned
            Reporter:
            chx Karoly Negyesi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              13 years, 3 weeks, 4 days ago