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
<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',{ "Person" : [ {"id":1,"name":"Richi",jobId:1}, {"id":2,"name":"Dave",jobId:2}, {"id":3,"name":"Tom",jobId:3}, {"id":4,"name":"Lisa",jobId:4}, {"id":5,"name":"Hanni",jobId:3}, {"id":6,"name":"Selma",jobId:3}, {"id":7,"name":"Ralf",jobId:1} ], "Jobs" : [ {"id":1,"name":"plumber"}, {"id":2,"name":"programmer"}, {"id":3,"name":"chef"}, {"id":4,"name":"hairdresser"} ] }); var people = new jsonOdm.Collection('Person'); people.$hasOne("jobId","id","Jobs","job"); var q = people.query(); // get all hairdresser var hairdresser = q.$or( q.$branch("jobId").$eq(4) ).$all(); // get all but hairdressers var hairdresser = q.$or( q.$branch("jobId").$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 <optional> 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 <static> 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 <optional> 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("customers"); customers.$hasOne("id","customerGroupId","customerGroup","group"); console.log(customers[0]); // > {name:"Some Name",age:"25",...,customerGroupId:1,gourp:{id:1,name:"VIP"},...} $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 <static> 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 <static> edgeIntersectsBounds(edge, bounds) Checks whether an edge intersects a boundary box or not Parameters: Name Type Description edge Array bounds Array Returns: Type boolean <static> 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 <optional> true also counts it as intersection if the edge is on the other edge Returns: Type boolean <static> 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 <static> 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 <static> 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 <static> 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 <static> 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 <static> 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 <static> 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 <static> 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.<geometry> 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.<geometry> object properties * <optional> Additional properties that belong to this feature boundaryBox Array <optional> An array with [min. longitude, min. latitude, max. longitude, max. latitude] id * <optional> 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.<jsonOdm.Geo.Feature> | Array boundaryBox Array <optional> 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 <optional> 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 <static> 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.<geometry> object Returns: Type boolean <static> 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.<geometry> 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 <optional> 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 <static> 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.<geometry> object Returns: Type boolean <static> 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.<geometry> 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 <optional> 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 <static> 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.<geometry> object Returns: Type boolean <static> 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.<geometry> 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 <optional> 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 <static> 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.<geometry> object Returns: Type boolean <static> 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.<geometry> 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 <optional> 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 <static> 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.<geometry> object Returns: Type boolean <static> 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.<geometry> 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 <optional> An array with [min. longitude, min. latitude, max. longitude, max. latitude] Example var point = new jsonOdm.Geo.Point([51.5,32]); Methods <static> 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.<geometry> object Returns: Type boolean <static> 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.<geometry> 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 <optional> 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 <static> 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.<geometry> object Returns: Type boolean <static> 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.<geometry> 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.<String> 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("myCollection"); var $query = collection.$query(); $query.$add( $query.$branch("firstValue"), $query.$subtract( $query.$branch("lastValue"), $query.$branch(["otherValues","firstValue"]) ) ).$eq(12).$all(); $aggregateCollection(afterValidation [, beforeCollect] [, aggregation]) Helper method for aggregation methods Parameters: Name Type Argument Description afterValidation Array.<function()> | function Push into the query queue after all commands have been executed. Returning false will result in a skip of this value beforeCollect Array.<function()> | function <optional> Push into the before collect queue to change or replace the collection element aggregation Array.<function()> | function <optional> 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("myCollection"); collection.$query() .$branch("id").$eq(2,9) .$all(); $and(queries) Compares sub query results using the boolean and Parameters: Name Type Argument Description queries jsonOdm.Query <repeatable> 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 <repeatable> 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("employees"); var $query = collection.$query(); $query.$avg("daysOff").$all(); console.log($query.$$accumulation); $branch(node) Go down the property tree of the collection Parameters: Name Type Argument Description node String <repeatable> 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("employees"); var $query = collection.$count(); $query.$count("daysOff").$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("myCollection"); collection.$query() .$branch("id").$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("myCollection"); var $query = collection.$query(); $query.$divide( $query.$branch("firstValue"), $query.$add( $query.$branch("lastValue"), $query.$branch(["otherValues","firstValue"]) ) ).$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 * <repeatable> 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 { "geo":[ { "type": "Feature", "properties": {...}, "geometry": { "type": "Polygon", "coordinates": [ ... ] } }, { "type": "Feature", "properties": {...}, "geometry": { "type": "Polygon", "coordinates": [ ... ] } }, ... ] } var collection = new jsonOdm.Collection("geo"), q = collection.$query().$branch("geometry").$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 { "geo":[ { "type": "Feature", "properties": {...}, "geometry": { "type": "Polygon", "coordinates": [ ... ] } }, { "type": "Feature", "properties": {...}, "geometry": { "type": "Polygon", "coordinates": [ ... ] } }, ... ] } var collection = new jsonOdm.Collection("geo"), q = collection.$query().$branch("geometry").$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 <repeatable> Returns: Type jsonOdm.Query Example var collection = new jsonOdm.Collection("employees"); var $query = collection.$query(); var groupedResult = $query.$and($query.$branch("age").$gt(21),$query.$branch("age").$lt(50)) // query before grouping .$group( "salaryRate", // as used with $branch ["salaryGroup","name"], // as used with $branch // A projection object defining the accumulation { missingDays:$query.$sum("daysAtHome"), holidayDays:$query.$sum("daysOnHoliday"), averageMissingDays:$query.$avg("daysAtHome"), averageHolidayDays:$query.$avg("daysOnHoliday"), count:$query.$count() } ).$all(); // RESULT COULD BE // [ // {"salaryRate":3300,"salaryGroup":{"name":"Developer"},"missingDays":22,"holidayDays":144,"averageMissingDays":11,"averageHolidayDays":72,"count":2}, // {"salaryRate":2800,"salaryGroup":{"name":"Tester"} ,"missingDays":10,"holidayDays":66 ,"averageMissingDays":5, "averageHolidayDays":33,"count":2}, // {"salaryRate":4800,"salaryGroup":{"name":"Boss"} ,"missingDays":12,"holidayDays":33 ,"averageMissingDays":12,"averageHolidayDays":33,"count":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 <repeatable> 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("employees"); var $query = collection.$query(); $query.$max("daysOff").$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 <repeatable> 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("employees"); var $query = collection.$query(); $query.$max("daysOff").$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("myCollection"); collection.$query() // get every fourth element, so elements with id 4,8,12,... when starting with id 1 .$branch("id").$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("myCollection"); var $query = collection.$query(); $query.$modulo( $query.$branch("firstValue"), $query.$add( $query.$branch("lastValue"), $query.$branch(["otherValues","firstValue"]) ) ).$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("myCollection"); var $query = collection.$query(); $query.$multiply( $query.$branch("firstValue"), $query.$add( $query.$branch("lastValue"), $query.$branch(["otherValues","firstValue"]) ) ).$eq(12).$all(); $nand(queries) Compares sub query results using the boolean nand Parameters: Name Type Argument Description queries jsonOdm.Query <repeatable> 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 * <repeatable> 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 <repeatable> A finite number of operators Returns: Type jsonOdm.Query $not(queries) An alisa for $nand Parameters: Name Type Argument Description queries jsonOdm.Query <repeatable> 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 <repeatable> 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("myBooks"); var $query = collection.$query() .$branch("id").$gt(12) // query before project .$project({ title: 1, isbn: { prefix: $query.$branch("isbn").$subString(0,3), group: $query.$branch("isbn").$subString(3,2), publisher: $query.$branch("isbn").$subString(5,4), title: $query.$branch("isbn").$subString(9,3), checkDigit: $query.$branch("isbn").$subString(12,1) }, lastName: function(element){return element.author.last}, // functions can be used as well copiesSold: $query.$branch("copies") }); 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("employees"); var $query = collection.$query(); $query.$push("daysOff").$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.<jsonOdm.Query> 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 <optional> The regular expression options, i.e. "i" for case insensitivity Returns: Type jsonOdm.Query Examples var collection = new jsonOdm.Collection("myCollection"); collection.$query() // gets all elements with a name of "Richard","RiChI","RichI","richard",... .$branch("name").$regex(/rich(i|ard)/i) .$all(); var collection = new jsonOdm.Collection("myCollection"); collection.$query() // gets all elements with a name of "Richard","RiChI","RichI","richard",... .$branch("name").$regex("rich(i|ard)","i") .$all(); $result( [start] [, length]) Returns a collection containing all matching elements within the given range Parameters: Name Type Argument Description start int <optional> return a subset starting at n; default = 0 length int <optional> return a subset with the length n; default = collection length Returns: Type * Example var collection = new jsonOdm.Collection("myCollection"); collection.$query() .$branch("id").$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("myCollection"); var $query = collection.$query(); $query.$subtract( $query.$branch("firstValue"), $query.$add( $query.$branch("lastValue"), $query.$branch(["otherValues","firstValue"]) ) ).$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 <repeatable> 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("employees"); var $query = collection.$query(); $query.$sum("daysOff").$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 "Ralf Tomson" and ("Jack" or "Josh") and not("Matteo") .$branch("name").$text("Jack Josh \\"Ralf Tomson\\" -Matteo") .$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 <repeatable> A list of allowed types for the selected field Returns: Type jsonOdm.Query Example var collection = new jsonOdm.Collection("myCollection"); collection.$query() // id is string or number and not undefined or null .$branch("id").$type("string","number") .$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("return this.name == 'Harry';").$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: "charAt", "charCodeAt", "concat", "fromCharCode", "indexOf", "lastIndexOf", "localeCompare", "match", "replace", "search", "slice", "split", "substr", "substring", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toUpperCase", "trim", "valueOf" Parameters: Name Type Argument Description args * <optional> The string methods parameter Returns: Type jsonOdm.Query Example var collection = new jsonOdm.Collection("myCollection"); var $query = collection.$query(); $query.$branch("explosionBy").$trim().$substr(0,3).$toUpperCase().$eq("TNT").$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