-
Type: New Feature
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework, Querying
-
Query
-
Fully Compatible
Please add a query that will return the "structure" of the document, instead of the data. The structure will allow application to understand the data that is embeded in the document, and then construct a query that will be efficient.
In concept, this is similar to the JDBC meta data query.
Given the schema-less of Mongo, I'm not sure that there is a perfect solution. The basic idea is to summarize the data. In theory, constructing a JSON schema from the data will work, but this is unrealistic approach.
Some ideas:
- Replace STRING values with "STRING(N)" (N is size)
- Replace ARRAY with ARRAY of TYPE. If all entries have same type (e.g., number, string) it will be ARRAY[N] of type. Otherwise ARRAY[N] of object.
- Replace BLOB with BLOB(n).
- Replace array of OBJECTS, with ARRAYS of ([ list of available attributes] )
Motivation:
When processing documents from existing repositories when the full structure is unknown, applications are forced to load complete documents, just to find out what data is available.
Having the ability to get (some) meta data, will reduce the amount of data that is loaded by a factor of 100X for our application.
- is duplicated by
-
SERVER-18207 Allow Queries for limit String sizes
- Closed
-
SERVER-18208 Allow Queries to find ARRAY sizes
- Closed
-
SERVER-18209 Add QUERY option to limit ARRAY size
- Closed
- related to
-
SERVER-13447 provide $projection operator to get type of field
- Closed