Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major - P3 Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0beta1
    • Component/s: None
    • Labels:
      None
    • # Replies:
      5
    • Last comment by Customer:
      false

      Description

      findAndModify method is missing from the MongoCollection class. It's an important feature.

        Activity

        Hide
        Kristina Chodorow (Inactive)
        added a comment -

        It's a database command, you can do:

        $db->command(array("findandmodify" => "collectionName", "query" => ...));

        See http://www.mongodb.org/display/DOCS/findandmodify+Command for details.

        Show
        Kristina Chodorow (Inactive)
        added a comment - It's a database command, you can do: $db->command(array("findandmodify" => "collectionName", "query" => ...)); See http://www.mongodb.org/display/DOCS/findandmodify+Command for details.
        Hide
        Matic
        added a comment -

        Yes, it is a database command. findandmodify interacts with documents inside a collection, so I think it's well suited to have it's own method in a MongoCollection class. The documentation for the command implies that a helper function will be available in the future. Quote: "If your driver doesn't yet provide a helper function for this command, run the command directly ..."

        Show
        Matic
        added a comment - Yes, it is a database command. findandmodify interacts with documents inside a collection, so I think it's well suited to have it's own method in a MongoCollection class. The documentation for the command implies that a helper function will be available in the future. Quote: "If your driver doesn't yet provide a helper function for this command, run the command directly ..."
        Hide
        Alister Bulman
        added a comment -

        doubtless, I had seen previous discussion of findAndModify elsewhere, but although I've seen several fairly hacked together versions of how to support something like this around (luckily, not in my own code), I'd never put it together with the idea of generating sequences, or locks before action until this week when 10Gen's Brendan McAdams spoke at the Mongo Meetup, this week.

        Having a driver-level command won't just make it easier to use, but also promote it as a more usable function.

        Show
        Alister Bulman
        added a comment - doubtless, I had seen previous discussion of findAndModify elsewhere, but although I've seen several fairly hacked together versions of how to support something like this around (luckily, not in my own code), I'd never put it together with the idea of generating sequences, or locks before action until this week when 10Gen's Brendan McAdams spoke at the Mongo Meetup, this week. Having a driver-level command won't just make it easier to use, but also promote it as a more usable function.
        Show
        Hannes Magnusson
        added a comment - https://github.com/mongodb/mongo-php-driver/pull/120
        Hide
        auto
        added a comment -

        Author:

        {u'date': u'2012-07-25T07:29:03-07:00', u'email': u'bjori@10gen.com', u'name': u'Hannes Magnusson'}

        Message: Fixed PHP-117 (Implement MongoCollection::findAndModify() helper)
        Branch: master
        https://github.com/mongodb/mongo-php-driver/commit/dc3adef6e010046de0be89e26325a7e13c61b813

        Show
        auto
        added a comment - Author: {u'date': u'2012-07-25T07:29:03-07:00', u'email': u'bjori@10gen.com', u'name': u'Hannes Magnusson'} Message: Fixed PHP-117 (Implement MongoCollection::findAndModify() helper) Branch: master https://github.com/mongodb/mongo-php-driver/commit/dc3adef6e010046de0be89e26325a7e13c61b813

          People

          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since reply:
              1 year, 32 weeks, 4 days ago
              Date of 1st Reply: