[SERVER-2105] Allow ability to update N items instead of all or first one found. Created: 16/Nov/10  Updated: 07/Mar/14  Resolved: 17/Nov/10

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Andre' Hazelwood Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

In some cases, it would be nice to update the top N items as part of a update query rather than having to retrieve all items and loop through the top N items to update them. For example, if I have 1000 customers, but I want to only apply a discount to those top 10 customers having sales over x amount, I would currently have to do a Find to retrieve all customers matching my criteria and then loop through and update the top 10. A cursor gets me part of the way, but still seems like a lot of overhead when I want to do just an atomic update.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 17/Nov/10 ]

SERVER-1599

Comment by Scott Hernandez (Inactive) [ 16/Nov/10 ]

This is a dup of this: http://jira.mongodb.org/browse/SERVER-1599

Generated at Thu Feb 08 02:58:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.