Articles → MONGODB → $Type Operator In Mongodb

$Type Operator In Mongodb






Purpose





Example




Picture showing the sample document collection






db.Employees.find({age:{$type:'number'}})


Picture showing getting the list of collection where age is of type number




Picture showing getting the list of collection where age is of type string



Using Array In Type




Picture showing using the $type operator with an array





Posted By  -  Karan Gupta
 
Posted On  -  Monday, March 4, 2024

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250