- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Which characters are NOT allowed in MongoDB field names?
Do not use $ symbol or period (.) because these characters are not allowed for MongoDB field names. The field shouldn’t start with $.
Here is an example of the allowed characters −
> db.charactersAllowedDemo.insertOne({"Employee Name" : "John"}); { "acknowledged" : true, "insertedId" : ObjectId("5c7fefbc8d10a061296a3c6d") }
Display all documents from a collection with the help of find() method. The query is as follows −
> db.charactersAllowedDemo.find().pretty();
The following is the output −
{ "_id" : ObjectId("5c7fefbc8d10a061296a3c6d"), "Employee Name" : "John" }
- Related Articles
- What are the allowed characters in Python function names?
- How to limit the number of characters allowed in form input text field?
- Check whether field exist in MongoDB or not?
- Calculate frequency of duplicate names from NAME field using MongoDB aggregate?
- What characters are valid for JavaScript variable names?
- References are not allowed in a SAP remote function call
- MongoDB Query for boolean field as “not true”
- Can I utilize indexes when querying by MongoDB subdocument without known field names?
- MongoDB aggregate to get the count of field values of corresponding duplicate names?
- MySQL Quoted table/field names vs unquoted names?
- Find MongoDB records where array field is not empty?
- Increment a field in MongoDB document which is embedded?
- How to limit the amount of characters returned from a field in a MongoDB?
- Find items that do not have a certain field in MongoDB?
- MongoDB query to select one field if the other is null and the first field if both are not null?

Advertisements