[DOCS-7684] Comment on: "manual/reference/operator/query/type.txt" Created: 18/Apr/16  Updated: 30/Oct/23  Resolved: 24/Jan/18

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: Done Votes: 0
Labels: collector-298ba4e7, docs-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 10

Location: https://docs.mongodb.org/manual/reference/operator/query/type/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
Referrer: https://www.google.es/
Screen Resolution: 1366 x 768
repo: docs
source: reference/operator/query/type


Participants:
Days since reply: 6 years, 3 weeks, 1 day ago

 Description   

Querying by Array Type

The query shown is incorrect. Also the $type operator for fields that are array s either of strings or of objects do not work



 Comments   
Comment by Kay Kim (Inactive) [ 24/Jan/18 ]

Before MongoDB 3.6, as mentioned in the v3.4 of the manual (which I believe this ticket was in regards to) https://docs.mongodb.com/v3.4/reference/operator/query/type/#arrays,

When applied to arrays, $type matches any inner element that is of the specified BSON type. For example, when matching for $type : 'array', the document will match if the field has a nested array. It will not return results where the field itself is an array.

In 3.6, $type will match an array field, not an array that contains an array as an element.

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