[DOCS-6267] Comment on: "manual/tutorial/create-an-auto-incrementing-field.txt" Created: 24/Sep/15  Updated: 30/Oct/23  Resolved: 01/Nov/22

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: bite-sized, docs-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Node.js

Location: http://docs.mongodb.org/v2.6/tutorial/create-an-auto-incrementing-field/
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Referrer: http://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/
Screen Resolution: 1440 x 900
repo: docs
source: tutorial/create-an-auto-incrementing-field


Participants:
Days since reply: 1 year, 14 weeks, 1 day ago
Epic Link: DOCSP-1769
Story Points: 0.25

 Description   

Hi,

This example never works directly in Node.js unless you specify sort field details and that too using 1 or 0.

counters.findAndModify({ _id:

{ $eq: "virtualcurrency" }

},

{ '_id': 1 }

, { $inc:

{ seq: 1 }

},

{ new: true }

, function (err, result) {

Regards



 Comments   
Comment by Education Bot [ 01/Nov/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 07:51:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.