UNPKG

json-odm

Version:

Object document mapper for JSON data that provides mongodb methods for querying and transformation as well as additional joining that is not provided by mongodb. >> IF YOU LIKE IT, PLEASE GIVE IT A STAR ON GITHUB <<

10 lines (9 loc) 52.5 kB
<html> <head> </head> <body style="background: transparent;"> <script src="scripts/docstrap.lib.js"></script> <script src="scripts/lunr.min.js"></script> <script src="scripts/fulltext-search.js"></script> <script type="text/x-docstrap-searchdb"> {"classes.list.html":{"id":"classes.list.html","title":"Classes","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Classes Classes JsonOdm Collection Geo BoundaryBox Feature FeatureCollection GeometryCollection LineString MultiLineString MultiPoint MultiPolygon Point Polygon Query Util Namespaces Query × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:53 pm using the DocStrap template. "},"index.html":{"id":"index.html","title":"Index","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:53 pm using the DocStrap template. "},"JsonOdm.html":{"id":"JsonOdm.html","title":"Class: JsonOdm","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: JsonOdm JsonOdm new JsonOdm() The main class holding all sub classes and the data source Author: Richard Burkhardt - Konsultaner Example var odm = new jsonOdm(); odm.addSource('people',{ &quot;Person&quot; : [ {&quot;id&quot;:1,&quot;name&quot;:&quot;Richi&quot;,jobId:1}, {&quot;id&quot;:2,&quot;name&quot;:&quot;Dave&quot;,jobId:2}, {&quot;id&quot;:3,&quot;name&quot;:&quot;Tom&quot;,jobId:3}, {&quot;id&quot;:4,&quot;name&quot;:&quot;Lisa&quot;,jobId:4}, {&quot;id&quot;:5,&quot;name&quot;:&quot;Hanni&quot;,jobId:3}, {&quot;id&quot;:6,&quot;name&quot;:&quot;Selma&quot;,jobId:3}, {&quot;id&quot;:7,&quot;name&quot;:&quot;Ralf&quot;,jobId:1} ], &quot;Jobs&quot; : [ {&quot;id&quot;:1,&quot;name&quot;:&quot;plumber&quot;}, {&quot;id&quot;:2,&quot;name&quot;:&quot;programmer&quot;}, {&quot;id&quot;:3,&quot;name&quot;:&quot;chef&quot;}, {&quot;id&quot;:4,&quot;name&quot;:&quot;hairdresser&quot;} ] }); var people = new jsonOdm.Collection('Person'); people.$hasOne(&quot;jobId&quot;,&quot;id&quot;,&quot;Jobs&quot;,&quot;job&quot;); var q = people.query(); // get all hairdresser var hairdresser = q.$or( q.$branch(&quot;jobId&quot;).$eq(4) ).$all(); // get all but hairdressers var hairdresser = q.$or( q.$branch(&quot;jobId&quot;).$ne(4) ).$all(); Methods addSource(sourceId, source, selectSource) Add a data source to the odm that is selectable via the selectSource method Parameters: Name Type Description sourceId * There is an override check source object An object with collection arrays selectSource boolean select the source selectSource(sourceId) Select a source by its id this will effect all collections Parameters: Name Type Description sourceId * × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:53 pm using the DocStrap template. "},"jsonOdm.Collection.html":{"id":"jsonOdm.Collection.html","title":"Class: Collection","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: Collection Collection new Collection( [collectionName]) The Collection class holding the date from the selected data source Parameters: Name Type Argument Description collectionName String &lt;optional&gt; The name of the selected collection. Leave empty if you want an empty collection but with all methods Returns: An array object with some extra methods added to it Type Collection Extends Array Methods &lt;static&gt; decorate(collection) Takes a collection object an appends all methods to it that are needed. This way we can work with a native array as a collection Parameters: Name Type Description collection jsonOdm.Collection $hasMany(foreignKeyMapName, privateKeyField, childCollectionName [, alias]) // TODO needs a proper has many functionality that aromatically gathers the child elements Creates a has many relation to another collection Parameters: Name Type Argument Description foreignKeyMapName Array | String The name of the field that holds an array of foreign keys privateKeyField int | String The private key of the foreign collection objects childCollectionName jsonOdm.Collection | String The child collection that belongs to the foreign keys alias String &lt;optional&gt; The new field that will carry all connected data. This field must not exist before setting the relation $hasOne(foreignKey, privateKeyField, childCollectionName, alias) Creates a has many relation to another collection Parameters: Name Type Description foreignKey String The name of the field holding a foreign key privateKeyField int | String The name of the private key field childCollectionName jsonOdm.Collection | String The child collection that belongs to the foreign keys alias String The new field that will carry the connected data. Example var customers = new jsonOdm.Collection(&quot;customers&quot;); customers.$hasOne(&quot;id&quot;,&quot;customerGroupId&quot;,&quot;customerGroup&quot;,&quot;group&quot;); console.log(customers[0]); // &gt; {name:&quot;Some Name&quot;,age:&quot;25&quot;,...,customerGroupId:1,gourp:{id:1,name:&quot;VIP&quot;},...} $query() Creates a query object filled with the right collection data Returns: A new query object Type jsonOdm.Query × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:53 pm using the DocStrap template. "},"jsonOdm.Geo.html":{"id":"jsonOdm.Geo.html","title":"Class: Geo","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: Geo Geo new Geo() The object to provide geographical data and methods. Warning: The coordinate reference system is WGS 84 witch uses the coordinate order [longitude,latitude]! Changing the coordinate reference system (CRS) is not supported yet. Classes BoundaryBox Feature FeatureCollection GeometryCollection LineString MultiLineString MultiPoint MultiPolygon Point Polygon Methods &lt;static&gt; detectAsGeometry(geometry) Takes an array and puts it into a GeoJSON geometry definition. If it geometry already is a valid GeoJSON it will only be returned Parameters: Name Type Description geometry Array | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.Point | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Returns: Type boolean | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.Point | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection &lt;static&gt; edgeIntersectsBounds(edge, bounds) Checks whether an edge intersects a boundary box or not Parameters: Name Type Description edge Array bounds Array Returns: Type boolean &lt;static&gt; edgeIntersectsEdge(edge1, edge2 [, allowOnEdge]) Method checks whether an edge intersects another edge Parameters: Name Type Argument Default Description edge1 Array A 2-dimensional array holding two vertices representing the edge, i.e. [[1,2],[4,2]] edge2 Array A 2-dimensional array holding two vertices representing the edge, i.e. [[1,2],[4,2]] allowOnEdge boolean &lt;optional&gt; true also counts it as intersection if the edge is on the other edge Returns: Type boolean &lt;static&gt; edgeIntersectsLineString(edge, lineString) The method checks whether a edge intersects a lineString or not. The polygon will be auto closed Parameters: Name Type Description edge Array A 2-dimensional array holding two vertices representing the edge, i.e. [[1,2],[4,2]] lineString Array A line representation i.e. [[1,2],[2,3],[4,4],[1,2]] Returns: Type boolean &lt;static&gt; edgeIntersectsPolygon(edge, polygon) The method checks whether a edge intersects a polygon or not. The polygon will be auto closed Parameters: Name Type Description edge Array A 2-dimensional array holding two vertices representing the edge, i.e. [[1,2],[4,2]] polygon Array A polygon representation i.e. [[1,2],[2,3],[4,4],[1,2]] Returns: Type boolean &lt;static&gt; edgeWithinPolygon(edge, polygon) The method checks whether a edge is inside a polygon or not. The polygon will be auto closed Parameters: Name Type Description edge Array A 2-dimensional array holding two vertices representing the edge, i.e. [[1,2],[4,2]] polygon Array A polygon representation i.e. [[1,2],[2,3],[4,4],[1,2]] Returns: Type boolean &lt;static&gt; lineStringWithinLineString(lineString, inLineString) TODO: ALSO needs to return true for [[1,1],[2,2,]] and [[0,0],[4,4]] // probably needs a rewrite Checks whether a line follows another line or is on the line respectively Parameters: Name Type Description lineString Array An array of points, i.e. [[1,1],[1,2],[1,3]] inLineString Array An array of points, i.e. [[1,1],[1,2],[1,3]] Returns: Type boolean &lt;static&gt; pointWithinBounds(point, bounds) Checks whether a point is inside a boundary box or not Parameters: Name Type Description point Array bounds Array Returns: Type boolean &lt;static&gt; pointWithinLineString(point, lineString) The method checks whether a point is on a line string path or not. Parameters: Name Type Description point Array A point representation i.e. [1,2] lineString Array A line string path representation i.e. [[1,2],[2,3],[4,4],[1,2]] Returns: Type boolean &lt;static&gt; pointWithinPolygon(point, polygon) The method checks whether a point is inside a polygon or not. The polygon will be auto closed Parameters: Name Type Description point Array A point representation i.e. [1,2] polygon Array A polygon representation i.e. [[1,2],[2,3],[4,4],[1,2]] Returns: Type boolean × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:53 pm using the DocStrap template. "},"jsonOdm.Geo.BoundaryBox.html":{"id":"jsonOdm.Geo.BoundaryBox.html","title":"Class: BoundaryBox","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: BoundaryBox .Geo. BoundaryBox new BoundaryBox(boundaryBox) A GeoJSON BoundaryBox object Parameters: Name Type Description boundaryBox Array An array with [min. longitude, min. latitude, max. longitude, max. latitude] Example var boundaryBox = new jsonOdm.Geo.BoundaryBox([-180.00,-90.00,180.00,90.00]); Methods &lt;static&gt; within(bounds, geometry) Checks whether a BoundaryBox is inside of another geometry Parameters: Name Type Description bounds jsonOdm.Geo.BoundaryBox geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Geo.Feature.html":{"id":"jsonOdm.Geo.Feature.html","title":"Class: Feature","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: Feature .Geo. Feature new Feature(geometry [, properties] [, boundaryBox] [, id]) A GeoJSON feature object Parameters: Name Type Argument Description geometry jsonOdm.Geo.Point | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object properties * &lt;optional&gt; Additional properties that belong to this feature boundaryBox Array &lt;optional&gt; An array with [min. longitude, min. latitude, max. longitude, max. latitude] id * &lt;optional&gt; A unique identifier × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Geo.FeatureCollection.html":{"id":"jsonOdm.Geo.FeatureCollection.html","title":"Class: FeatureCollection","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: FeatureCollection .Geo. FeatureCollection new FeatureCollection(features [, boundaryBox]) The GeoJSON FeatureCollection object Parameters: Name Type Argument Description features Array.&lt;jsonOdm.Geo.Feature&gt; | Array boundaryBox Array &lt;optional&gt; An array with [min. longitude, min. latitude, max. longitude, max. latitude] × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Geo.GeometryCollection.html":{"id":"jsonOdm.Geo.GeometryCollection.html","title":"Class: GeometryCollection","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: GeometryCollection .Geo. GeometryCollection new GeometryCollection(geometries [, boundaryBox]) A GeoJSON GeometryCollection object Parameters: Name Type Argument Description geometries Array An array of GeoJSON geometry objects boundaryBox Array &lt;optional&gt; An array with [min. longitude, min. latitude, max. longitude, max. latitude] Example var polygons = new jsonOdm.Geo.GeometryCollection([ new jsonOdm.Geo.LineString([[51.5,32.1],[51.6,21]]), new jsonOdm.Geo.MultiPoint([[51.5,32],[51.6,21]]), new jsonOdm.Geo.LineString([[51.3,32.2],[51.9,21]]) ]); Methods &lt;static&gt; intersects(geometryCollection, geometry) Checks whether a GeometryCollection intersects another geometry Parameters: Name Type Description geometryCollection jsonOdm.Geo.GeometryCollection geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean &lt;static&gt; within(geometryCollection, geometry) Checks whether a GeometryCollection is inside of another geometry Parameters: Name Type Description geometryCollection jsonOdm.Geo.GeometryCollection geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Geo.LineString.html":{"id":"jsonOdm.Geo.LineString.html","title":"Class: LineString","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: LineString .Geo. LineString new LineString(positions [, boundaryBox]) A GeoJSON LineString object Parameters: Name Type Argument Description positions Array An at least 2-dimensional array of 2-dimensional arrays with the first entry being the longitude and the second one being the latitude, i.e. [[51,32],[51.4,21]] boundaryBox Array &lt;optional&gt; An array with [min. longitude, min. latitude, max. longitude, max. latitude] Example var lineString = new jsonOdm.Geo.LineString([ [51.5,32],[51.6,21] ]); Methods &lt;static&gt; intersects(lineString, geometry) Checks whether a LineString intersects another geometry Parameters: Name Type Description lineString jsonOdm.Geo.LineString geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean &lt;static&gt; within(lineString, geometry) Checks whether a LineString is inside of another geometry Parameters: Name Type Description lineString jsonOdm.Geo.LineString geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Geo.MultiLineString.html":{"id":"jsonOdm.Geo.MultiLineString.html","title":"Class: MultiLineString","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: MultiLineString .Geo. MultiLineString new MultiLineString(positions [, boundaryBox]) A GeoJSON MultiLineString object Parameters: Name Type Argument Description positions Array An array of arrays with at least 2-dimensional arrays of 2-dimensional arrays with the first entry being the longitude and the second one being the latitude. boundaryBox Array &lt;optional&gt; An array with [min. longitude, min. latitude, max. longitude, max. latitude] Example var multiLineString = new jsonOdm.Geo.MultiLineString([ [[51.2,32],[51.4,21]], [[51.5,32],[51.6,21]] ]); Methods &lt;static&gt; intersects(multiLineString, geometry) Checks whether a MultiLineString intersects another geometry Parameters: Name Type Description multiLineString jsonOdm.Geo.MultiLineString geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean &lt;static&gt; within(multiLineString, geometry) Checks whether a MultiLineString is inside of another geometry Parameters: Name Type Description multiLineString jsonOdm.Geo.MultiLineString geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Geo.MultiPoint.html":{"id":"jsonOdm.Geo.MultiPoint.html","title":"Class: MultiPoint","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: MultiPoint .Geo. MultiPoint new MultiPoint(positions [, boundaryBox]) A GeoJSON MultiPoint object Parameters: Name Type Argument Description positions Array An array of 2-dimensional arrays with the first entry being the longitude and the second one being the latitude, i.e. [[51,32],[51.4,21]] boundaryBox Array &lt;optional&gt; An array with [min. longitude, min. latitude, max. longitude, max. latitude] Example var multiPoint = new jsonOdm.Geo.MultiPoint([ [51.5,32],[51.6,21] ]); Methods &lt;static&gt; intersects(multiPoint, geometry) Checks whether a MultiPoint intersects another geometry Parameters: Name Type Description multiPoint jsonOdm.Geo.MultiPoint geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean &lt;static&gt; within(multiPoint, geometry) Checks whether a MultiPoint is inside of another geometry Parameters: Name Type Description multiPoint jsonOdm.Geo.MultiPoint geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Geo.MultiPolygon.html":{"id":"jsonOdm.Geo.MultiPolygon.html","title":"Class: MultiPolygon","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: MultiPolygon .Geo. MultiPolygon new MultiPolygon(positions [, boundaryBox]) A GeoJSON MultiPolygon object Parameters: Name Type Argument Description positions Array An array of Polygon position arrays boundaryBox Array &lt;optional&gt; An array with [min. longitude, min. latitude, max. longitude, max. latitude] Example var polygons = new jsonOdm.Geo.MultiPolygon([ [ [[51.2,32],[51.4,21],[51.6,21],[51.2,21]], [[51.5,32],[51.6,21],[51.7,21],[51.5,21]] ], [ [[51.2,32],[51.4,21],[51.6,21],[51.2,21]], [[51.5,32],[51.6,21],[51.7,21],[51.5,21]] ] ]); Methods &lt;static&gt; intersects(multiPolygon, geometry) Checks whether a MultiPolygon intersects another geometry Parameters: Name Type Description multiPolygon jsonOdm.Geo.MultiPolygon geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean &lt;static&gt; within(multiPolygon, geometry) Checks whether a MultiPolygon is inside of another geometry Parameters: Name Type Description multiPolygon jsonOdm.Geo.MultiPolygon geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Geo.Point.html":{"id":"jsonOdm.Geo.Point.html","title":"Class: Point","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: Point .Geo. Point new Point(position [, boundaryBox]) A GeoJSON Point object Parameters: Name Type Argument Description position Array A 2-dimensional array with the first entry being the longitude and the second one being the latitude, i.e. [51,32] boundaryBox Array &lt;optional&gt; An array with [min. longitude, min. latitude, max. longitude, max. latitude] Example var point = new jsonOdm.Geo.Point([51.5,32]); Methods &lt;static&gt; intersects(point, geometry) Checks whether a Point intersects a geometry witch is equal to the Point being inside a geometry. This is an alias of jsonOdm.Geo.Point.within Parameters: Name Type Description point jsonOdm.Geo.Point geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean &lt;static&gt; within(point, geometry) Checks whether a Point is inside of another geometry Parameters: Name Type Description point jsonOdm.Geo.Point geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Geo.Polygon.html":{"id":"jsonOdm.Geo.Polygon.html","title":"Class: Polygon","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Class: Polygon .Geo. Polygon new Polygon(positions [, boundaryBox]) A GeoJSON Polygon object Parameters: Name Type Argument Description positions Array An array of arrays with at least 2-dimensional arrays of 2-dimensional arrays with the first entry being the longitude and the second one being the latitude. boundaryBox Array &lt;optional&gt; An array with [min. longitude, min. latitude, max. longitude, max. latitude] Example var polygon = new jsonOdm.Geo.Polygon([ // The last position should be equal to the first one to close the polygon [[51.2,32],[51.4,21],[51.6,21],[51.2,21]], // Must be fully inside the n-1th poly-line [[51.5,32],[51.6,21],[51.7,21],[51.5,21]] // more inner holes might follow ]); Methods &lt;static&gt; intersects(polygon, geometry) Checks whether a Polygon intersects another geometry Parameters: Name Type Description polygon jsonOdm.Geo.Polygon geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean &lt;static&gt; within(polygon, geometry) Checks whether a Polygon is inside of another geometry Parameters: Name Type Description polygon jsonOdm.Geo.Polygon geometry jsonOdm.Geo.Point | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Any jsonOdm.Geo.&lt;geometry&gt; object Returns: Type boolean × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Query.html":{"id":"jsonOdm.Query.html","title":"Namespace: Query","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.PolygonjsonOdm.QueryjsonOdm.Util Namespace: Query Query Methods $accumulator(nodes, accumulator) Go down the property tree of the collection Parameters: Name Type Description nodes Array.&lt;String&gt; A variable of nodes to traverse down the json tree accumulator function Returns: Type jsonOdm.Query $add(branch1, branch2) Performs an arithmetic addition on two or more field values Parameters: Name Type Description branch1 jsonOdm.Query | Number branch2 jsonOdm.Query | Number Returns: jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); var $query = collection.$query(); $query.$add( $query.$branch(&quot;firstValue&quot;), $query.$subtract( $query.$branch(&quot;lastValue&quot;), $query.$branch([&quot;otherValues&quot;,&quot;firstValue&quot;]) ) ).$eq(12).$all(); $aggregateCollection(afterValidation [, beforeCollect] [, aggregation]) Helper method for aggregation methods Parameters: Name Type Argument Description afterValidation Array.&lt;function()&gt; | function Push into the query queue after all commands have been executed. Returning false will result in a skip of this value beforeCollect Array.&lt;function()&gt; | function &lt;optional&gt; Push into the before collect queue to change or replace the collection element aggregation Array.&lt;function()&gt; | function &lt;optional&gt; If the result of the whole aggregation changes, i.e. for searching, or ordering Returns: Type jsonOdm.Query $all() Returns a collection containing all matching elements Returns: Type jsonOdm.Collection Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); collection.$query() .$branch(&quot;id&quot;).$eq(2,9) .$all(); $and(queries) Compares sub query results using the boolean and Parameters: Name Type Argument Description queries jsonOdm.Query &lt;repeatable&gt; A finite number of operators Returns: Type jsonOdm.Query $avg(branch) Performs the accumulation average of a field. It's integrated to be used with $group. May as well be used as stand alone. Parameters: Name Type Argument Description branch String &lt;repeatable&gt; Internally calls the $branch method to receive the field values Returns: Type jsonOdm.Query Example // SHOULD BE USED WITH $group var collection = new jsonOdm.Collection(&quot;employees&quot;); var $query = collection.$query(); $query.$avg(&quot;daysOff&quot;).$all(); console.log($query.$$accumulation); $branch(node) Go down the property tree of the collection Parameters: Name Type Argument Description node String &lt;repeatable&gt; A variable amount of nodes to traverse down the document tree Returns: Type jsonOdm.Query $count() Counts the grouped elements Returns: Type jsonOdm.Query Example // SHOULD BE USED WITH $group var collection = new jsonOdm.Collection(&quot;employees&quot;); var $query = collection.$count(); $query.$count(&quot;daysOff&quot;).$all(); expect(collection.length).toBe($query.$$accumulation); $delete() Returns a collection containing all matching elements Returns: Type jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); collection.$query() .$branch(&quot;id&quot;).$gt(500) .$delete(); $divide(branch) Performs an arithmetic divition on two or more field values Parameters: Name Type Description branch jsonOdm.Query | Number Returns: jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); var $query = collection.$query(); $query.$divide( $query.$branch(&quot;firstValue&quot;), $query.$add( $query.$branch(&quot;lastValue&quot;), $query.$branch([&quot;otherValues&quot;,&quot;firstValue&quot;]) ) ).$eq(12).$all(); $eq(comparable) Compares the current sub collection value with the comparable like this $eq('1','2','4') so 1 or 2 or 4 are valid fields Parameters: Name Type Argument Description comparable * &lt;repeatable&gt; Values to compare the current field with Returns: Type jsonOdm.Query $exists() Compares the current sub collection value to not be undefined Returns: Type jsonOdm.Query $first() Short hand version for $all(true) Returns: Type jsonOdm.Collection $geoIntersects(geometry) Checks whether the current field geometry intersects the given geometry object Warning: The coordinate reference system is WGS 84witch uses the coordinate order [longitude,latitude]! The method automatically transforms arrays into the assumed GeoJSON definitions where: [10,10] transforms into a jsonOdm.Geo.Point [[10,10],[10,12],...] transforms into a jsonOdm.Geo.LineString [[[10,10],[10,12],...],...] transforms into a jsonOdm.Geo.Polygon [[[[10,10],[10,12],...],...],...] transforms into a jsonOdm.Geo.MultiPolygon or simply use a GeoJSON object definition from jsonOdm.Geo Parameters: Name Type Description geometry Array | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.Point | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Returns: Type jsonOdm.Query Example { &quot;geo&quot;:[ { &quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {...}, &quot;geometry&quot;: { &quot;type&quot;: &quot;Polygon&quot;, &quot;coordinates&quot;: [ ... ] } }, { &quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {...}, &quot;geometry&quot;: { &quot;type&quot;: &quot;Polygon&quot;, &quot;coordinates&quot;: [ ... ] } }, ... ] } var collection = new jsonOdm.Collection(&quot;geo&quot;), q = collection.$query().$branch(&quot;geometry&quot;).$geoIntersects(new jsonOdm.Geo.BoundaryBox([129.049317,-31.434555,139.464356,-19.068644])); //found geometries geometries = q.$all(); $geoWithin(geometry) Checks whether the current field geometry is within the given geometry object Warning: The coordinate reference system is WGS 84witch uses the coordinate order [longitude,latitude]! The method automatically transforms arrays into the assumed GeoJSON definitions where: [10,10] transforms into a jsonOdm.Geo.Point [[10,10],[10,12],...] transforms into a jsonOdm.Geo.LineString [[[10,10],[10,12],...],...] transforms into a jsonOdm.Geo.Polygon [[[[10,10],[10,12],...],...],...] transforms into a jsonOdm.Geo.MultiPolygon or simply use a GeoJSON object definition from jsonOdm.Geo Parameters: Name Type Description geometry Array | jsonOdm.Geo.BoundaryBox | jsonOdm.Geo.Point | jsonOdm.Geo.MultiPoint | jsonOdm.Geo.LineString | jsonOdm.Geo.MultiLineString | jsonOdm.Geo.Polygon | jsonOdm.Geo.MultiPolygon | jsonOdm.Geo.GeometryCollection Returns: Type jsonOdm.Query Example { &quot;geo&quot;:[ { &quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {...}, &quot;geometry&quot;: { &quot;type&quot;: &quot;Polygon&quot;, &quot;coordinates&quot;: [ ... ] } }, { &quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {...}, &quot;geometry&quot;: { &quot;type&quot;: &quot;Polygon&quot;, &quot;coordinates&quot;: [ ... ] } }, ... ] } var collection = new jsonOdm.Collection(&quot;geo&quot;), q = collection.$query().$branch(&quot;geometry&quot;).$geoWithin(new jsonOdm.Geo.BoundaryBox([129.049317,-31.434555,139.464356,-19.068644])); //found geometries geometries = q.$all(); $group() Groups all elements of a collection by a given grouping schema Parameters: Type Argument Description jsonOdm.Query &lt;repeatable&gt; Returns: Type jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;employees&quot;); var $query = collection.$query(); var groupedResult = $query.$and($query.$branch(&quot;age&quot;).$gt(21),$query.$branch(&quot;age&quot;).$lt(50)) // query before grouping .$group( &quot;salaryRate&quot;, // as used with $branch [&quot;salaryGroup&quot;,&quot;name&quot;], // as used with $branch // A projection object defining the accumulation { missingDays:$query.$sum(&quot;daysAtHome&quot;), holidayDays:$query.$sum(&quot;daysOnHoliday&quot;), averageMissingDays:$query.$avg(&quot;daysAtHome&quot;), averageHolidayDays:$query.$avg(&quot;daysOnHoliday&quot;), count:$query.$count() } ).$all(); // RESULT COULD BE // [ // {&quot;salaryRate&quot;:3300,&quot;salaryGroup&quot;:{&quot;name&quot;:&quot;Developer&quot;},&quot;missingDays&quot;:22,&quot;holidayDays&quot;:144,&quot;averageMissingDays&quot;:11,&quot;averageHolidayDays&quot;:72,&quot;count&quot;:2}, // {&quot;salaryRate&quot;:2800,&quot;salaryGroup&quot;:{&quot;name&quot;:&quot;Tester&quot;} ,&quot;missingDays&quot;:10,&quot;holidayDays&quot;:66 ,&quot;averageMissingDays&quot;:5, &quot;averageHolidayDays&quot;:33,&quot;count&quot;:2}, // {&quot;salaryRate&quot;:4800,&quot;salaryGroup&quot;:{&quot;name&quot;:&quot;Boss&quot;} ,&quot;missingDays&quot;:12,&quot;holidayDays&quot;:33 ,&quot;averageMissingDays&quot;:12,&quot;averageHolidayDays&quot;:33,&quot;count&quot;:1} // ] $gt(comparable) Compares the current sub collection value with the comparable like this $gt('1') field values greater then 1 are valid Parameters: Name Type Description comparable * Values to compare the current field with Returns: Type jsonOdm.Query $gte(comparable) Compares the current sub collection value with the comparable like this $gte('1') field values greater then or equal to 1 are valid Parameters: Name Type Description comparable * Values to compare the current field with Returns: Type jsonOdm.Query $in(comparable) Compares the current sub collection value with the comparable like this $in(['1','2','4']) so 1 or 2 or 4 are valid fields Parameters: Name Type Description comparable Array Values to compare the current field with Returns: Type jsonOdm.Query $isNull() Compares the current sub collection value to be null or undefined Returns: Type jsonOdm.Query $lt(comparable) Compares the current sub collection value with the comparable like this $lt('1') field values less then 1 are valid Parameters: Name Type Description comparable * Values to compare the current field with Returns: Type jsonOdm.Query $lte(comparable) Compares the current sub collection value with the comparable like this $lte('1') field values less then or equal to 1 are valid Parameters: Name Type Description comparable * Values to compare the current field with Returns: Type jsonOdm.Query $max(branch) Performs the accumulation max of a field. It's integrated to be used with $group. May as well be used as stand alone. Parameters: Name Type Argument Description branch String &lt;repeatable&gt; Internally calls the $branch method to receive the field values Returns: Type jsonOdm.Query Example // SHOULD BE USED WITH $group var collection = new jsonOdm.Collection(&quot;employees&quot;); var $query = collection.$query(); $query.$max(&quot;daysOff&quot;).$all(); console.log($query.$$accumulation); $min(branch) Performs the accumulation min of a field. It's integrated to be used with $group. May as well be used as stand alone. Parameters: Name Type Argument Description branch String &lt;repeatable&gt; Internally calls the $branch method to receive the field values Returns: Type jsonOdm.Query Example // SHOULD BE USED WITH $group var collection = new jsonOdm.Collection(&quot;employees&quot;); var $query = collection.$query(); $query.$max(&quot;daysOff&quot;).$all(); console.log($query.$$accumulation); $mod() Compares the given reminder against the selected field value modulo the given divisor Returns: Type jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); collection.$query() // get every fourth element, so elements with id 4,8,12,... when starting with id 1 .$branch(&quot;id&quot;).$mod(4,0) .$all(); $modifyField() Modify fields before validation Returns: Type jsonOdm.Query $modulo(branch, module) Performs an arithmetic modulo on two or more field values Parameters: Name Type Description branch jsonOdm.Query | Number module jsonOdm.Query | Number Returns: jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); var $query = collection.$query(); $query.$modulo( $query.$branch(&quot;firstValue&quot;), $query.$add( $query.$branch(&quot;lastValue&quot;), $query.$branch([&quot;otherValues&quot;,&quot;firstValue&quot;]) ) ).$eq(12).$all(); $multiply(branch) Performs an arithmetic multiplication on two or more field values Parameters: Name Type Description branch jsonOdm.Query | Number Returns: jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); var $query = collection.$query(); $query.$multiply( $query.$branch(&quot;firstValue&quot;), $query.$add( $query.$branch(&quot;lastValue&quot;), $query.$branch([&quot;otherValues&quot;,&quot;firstValue&quot;]) ) ).$eq(12).$all(); $nand(queries) Compares sub query results using the boolean nand Parameters: Name Type Argument Description queries jsonOdm.Query &lt;repeatable&gt; A finite number of operators Returns: Type jsonOdm.Query $ne(comparable) Compares the current sub collection value with the comparable like this $ne('1','2','4') so 1 or 2 or 4 are not valid fields Parameters: Name Type Argument Description comparable * &lt;repeatable&gt; Values to compare the current field with Returns: Type jsonOdm.Query $nin(comparable) Compares the current sub collection value with the comparable like this $nin(['1','2','4']) so 1 or 2 or 4 are not valid fields Parameters: Name Type Description comparable Array Values to compare the current field with Returns: Type jsonOdm.Query $nor(queries) Compares sub query results using the boolean nor Parameters: Name Type Argument Description queries jsonOdm.Query &lt;repeatable&gt; A finite number of operators Returns: Type jsonOdm.Query $not(queries) An alisa for $nand Parameters: Name Type Argument Description queries jsonOdm.Query &lt;repeatable&gt; A finite number of operators See: jsonOdm.Query.$nand Returns: Type jsonOdm.Query $or(queries) Compares sub query results using the boolean or Parameters: Name Type Argument Description queries jsonOdm.Query &lt;repeatable&gt; A finite number of operators Returns: Type jsonOdm.Query $project(projection) Projects all elements of the collection into a given schema Parameters: Name Type Description projection * The projection definition with nested definitions Returns: Type jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;myBooks&quot;); var $query = collection.$query() .$branch(&quot;id&quot;).$gt(12) // query before project .$project({ title: 1, isbn: { prefix: $query.$branch(&quot;isbn&quot;).$subString(0,3), group: $query.$branch(&quot;isbn&quot;).$subString(3,2), publisher: $query.$branch(&quot;isbn&quot;).$subString(5,4), title: $query.$branch(&quot;isbn&quot;).$subString(9,3), checkDigit: $query.$branch(&quot;isbn&quot;).$subString(12,1) }, lastName: function(element){return element.author.last}, // functions can be used as well copiesSold: $query.$branch(&quot;copies&quot;) }); var collectionResult = $query.$all(); $push() adds the grouped elements to result set Returns: Type jsonOdm.Query Example // SHOULD BE USED WITH $group var collection = new jsonOdm.Collection(&quot;employees&quot;); var $query = collection.$query(); $query.$push(&quot;daysOff&quot;).$all() expect(collection.length).toBe($query.$$accumulation.length); $queryOperator(queries, operator) Test a collection or collection field against one or more values Parameters: Name Type Description queries Array.&lt;jsonOdm.Query&gt; A finite number of operators operator function the test function to evaluate the values Returns: Type jsonOdm.Query $regex(regex [, options]) Tests a selected field against the regular expression Parameters: Name Type Argument Description regex RegExp | string The regular expression to test against options string &lt;optional&gt; The regular expression options, i.e. &quot;i&quot; for case insensitivity Returns: Type jsonOdm.Query Examples var collection = new jsonOdm.Collection(&quot;myCollection&quot;); collection.$query() // gets all elements with a name of &quot;Richard&quot;,&quot;RiChI&quot;,&quot;RichI&quot;,&quot;richard&quot;,... .$branch(&quot;name&quot;).$regex(/rich(i|ard)/i) .$all(); var collection = new jsonOdm.Collection(&quot;myCollection&quot;); collection.$query() // gets all elements with a name of &quot;Richard&quot;,&quot;RiChI&quot;,&quot;RichI&quot;,&quot;richard&quot;,... .$branch(&quot;name&quot;).$regex(&quot;rich(i|ard)&quot;,&quot;i&quot;) .$all(); $result( [start] [, length]) Returns a collection containing all matching elements within the given range Parameters: Name Type Argument Description start int &lt;optional&gt; return a subset starting at n; default = 0 length int &lt;optional&gt; return a subset with the length n; default = collection length Returns: Type * Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); collection.$query() .$branch(&quot;id&quot;).$eq(2,9) .$result(1,3); $subtract(branch) Performs an arithmetic subtraction on two or more field values Parameters: Name Type Description branch jsonOdm.Query | Number Returns: jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); var $query = collection.$query(); $query.$subtract( $query.$branch(&quot;firstValue&quot;), $query.$add( $query.$branch(&quot;lastValue&quot;), $query.$branch([&quot;otherValues&quot;,&quot;firstValue&quot;]) ) ).$eq(12).$all(); $sum(branch) Performs the accumulation sum of a field. It's integrated to be used with $group. May as well be used as stand alone. Parameters: Name Type Argument Description branch String &lt;repeatable&gt; Internally calls the $branch method to receive the field values Returns: Type jsonOdm.Query Example // SHOULD BE USED WITH $group var collection = new jsonOdm.Collection(&quot;employees&quot;); var $query = collection.$query(); $query.$sum(&quot;daysOff&quot;).$all(); console.log($query.$$accumulation); $testCollection(comparables, collectionTest) Test a collection or collection field against one or more values Parameters: Name Type Description comparables * An array of values to test again collectionTest function the test function to evaluate the values Returns: Type jsonOdm.Query $text(text) Performs a text search on a given collection with the same notation used by mongodb In contrast to mongodb this method does not implement stop words elimination or word stamming at the moment Parameters: Name Type Description text String Returns: Type jsonOdm.Query Example collection.$query() // Must find &quot;Ralf Tomson&quot; and (&quot;Jack&quot; or &quot;Josh&quot;) and not(&quot;Matteo&quot;) .$branch(&quot;name&quot;).$text(&quot;Jack Josh \\&quot;Ralf Tomson\\&quot; -Matteo&quot;) .$all(); $type(type) Compares the current sub collection against the given types using the binary of and the JavaScript typeof Supported (case insensitive) types are: number, string, undefined, object, array and RegExp, ArrayBuffer, null, boolean plus all other [object *] types Parameters: Name Type Argument Description type string &lt;repeatable&gt; A list of allowed types for the selected field Returns: Type jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); collection.$query() // id is string or number and not undefined or null .$branch(&quot;id&quot;).$type(&quot;string&quot;,&quot;number&quot;) .$all(); $where(evaluation) Performs a query selection by a self defined function of function body string. The function context (this) will be the current collection or a value selected by $branch. Parameters: Name Type Description evaluation string | function Returns: Type jsonOdm.Query Example // !!!! NOT SUPPORTED ANYMORE !!!! using a string to find Harry collection.$query().$where(&quot;return this.name == 'Harry';&quot;).$first(); // using a function to find Harry collection.$query().$where(function(){return this.name == 'Harry';}).$first(); // using $where after selecting a branch collection.$query().$('name').$where(function(){return this == 'Harry';}).$first(); StringPrototype( [args]) A generation for all native String.prototype methods to make them available via $modifyField Supported Methods are: &quot;charAt&quot;, &quot;charCodeAt&quot;, &quot;concat&quot;, &quot;fromCharCode&quot;, &quot;indexOf&quot;, &quot;lastIndexOf&quot;, &quot;localeCompare&quot;, &quot;match&quot;, &quot;replace&quot;, &quot;search&quot;, &quot;slice&quot;, &quot;split&quot;, &quot;substr&quot;, &quot;substring&quot;, &quot;toLocaleLowerCase&quot;, &quot;toLocaleUpperCase&quot;, &quot;toLowerCase&quot;, &quot;toUpperCase&quot;, &quot;trim&quot;, &quot;valueOf&quot; Parameters: Name Type Argument Description args * &lt;optional&gt; The string methods parameter Returns: Type jsonOdm.Query Example var collection = new jsonOdm.Collection(&quot;myCollection&quot;); var $query = collection.$query(); $query.$branch(&quot;explosionBy&quot;).$trim().$substr(0,3).$toUpperCase().$eq(&quot;TNT&quot;).$all(); × Search results Close Documentation generated by JSDoc 3.4.0 on July 15th 2016, 4:15:54 pm using the DocStrap template. "},"jsonOdm.Util.html":{"id":"jsonOdm.Util.html","title":"Class: Util","body":" Documentation Classes JsonOdmjsonOdm.CollectionjsonOdm.GeojsonOdm.Geo.BoundaryBoxjsonOdm.Geo.FeaturejsonOdm.Geo.FeatureCollectionjsonOdm.Geo.GeometryCollectionjsonOdm.Geo.LineStringjsonOdm.Geo.MultiLineStringjsonOdm.Geo.MultiPointjsonOdm.Geo.MultiPolygonjsonOdm.Geo.PointjsonOdm.Geo.Poly