[DOCS-6462] How can you query for a field with spaces in its name? Created: 27/Oct/15  Updated: 30/Oct/23  Resolved: 03/Nov/17

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: Stennie Steneker (Inactive)
Resolution: Done Votes: 0
Labels: mts
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: https://docs.mongodb.org/manual/core/document/
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0
Screen Resolution: 1920 x 1200
repo: docs
source: core/document


Participants:
Days since reply: 6 years, 14 weeks, 5 days ago
Story Points: 0.25

 Description   

Tried to find a statement on blank characters (or other white space) anywhere in field names - didn't find any.

E.g. should I be able to insert or query a document like this?

{ "first name" : "Mickey", "last name " : "Mouse"}

 Comments   
Comment by Stennie Steneker (Inactive) [ 03/Nov/17 ]

The MongoDB manual includes information on Restrictions on Field Names. White space characters are allowed, so this example will work:

db.examples.insert({ "first name" : "Mickey", "last name " : "Mouse"})
db.examples.find({ "last name " : "Mouse"})

Note that the DOCS project is for reporting documentation errata or suggestions. For appropriate channels for MongoDB-related support discussion please refer to Technical Support options in the MongoDB documentation.

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