[DOCS-16062] [Server] Example and commands error Created: 24/Apr/23  Updated: 13/Nov/23  Resolved: 05/Jun/23

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: currentVersion
Fix Version/s: 6.0.0, 6.3.0, 7.0.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Critical - P2
Reporter: AX Hu Assignee: Ashley Brown
Resolution: Fixed Votes: 0
Labels: doc-example-improvement, fix_suggested, quick-win
Remaining Estimate: 30 minutes
Time Spent: Not Specified
Original Estimate: 30 minutes
Environment:

Windows 10
Microsoft Edge 112.0.1722.48


Attachments: PNG File image-2023-04-24-21-11-14-574.png     PNG File image-2023-04-24-21-34-42-499.png    
Participants:
Days since reply: 40 weeks, 5 days ago

 Description   

There are 2 errors in Create a View with Default Collation — MongoDB Manual.

Q1: The example blow is error: list in JSON need ","(See in attach file: image-2023-04-24-21-11-14-574.png):

db.places.insertMany([
   { _id: 1, category: "café" }
   { _id: 2, category: "cafe" }
   { _id: 3, category: "cafE" }
]) 

It should be like below:

 

db.places.insertMany([
   { _id: 1, category: "café" },
   { _id: 2, category: "cafe" },
   { _id: 3, category: "cafE" }
]) 

 

Q2: The command Collection.count() is deprecated(See in attach file: image-2023-04-24-21-34-42-499.png):

db.placesView.count( { category: "cafe" } ) 

I suggest to use Collection.countDocuments():

db.placesView.countDocuments( {category: "cafe"} ) 

 
 

 



 Comments   
Comment by AX Hu [ 29/Apr/23 ]

I submit a PR Docs 16062 by haxung · Pull Request #6256 · mongodb/docs (github.com) to fix this error in github, what can I do next step?

Generated at Thu Feb 08 08:14:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.