Skip to content

Commit

Permalink
fixed global object. fixed example in README.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
konsultaner committed Apr 25, 2018
1 parent 8a637db commit 5eb9f6f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,17 @@ odm.addSource('people',{
{"id":4,"name":"coding"},
{"id":5,"name":"dancing"}
]
});
},true);
// instantiate a collection object
var people = new jsonOdm.Collection('Person');
var people = new odm.Collection('Person');
people.$hasOne("jobId","id","Jobs","job");
people.$hasMany("hobbyIds","id","Hobbies","hobbies");

var q = people.query();
var q = people.$query();
// get all hairdresser and plumber
var hairdresser = q.$or(
q.$branch("jobId").$eq(1),
q.$branch("jobId").$eq(4)
q.$branch("jobId").$eq(1),
q.$branch("jobId").$eq(4)
).$all();

// get all but hairdressers and plumbers
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-odm",
"version": "0.2.3",
"version": "0.2.4",
"description": "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 <<",
"main": " ./bin/json.odm.min.js",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion src/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (typeof jsonOdm === "undefined") {
if(typeof module === "undefined"){
jsonOdm = new JsonOdm();
}else{
jsonOdm = require('./odm');
jsonOdm = global.jsonOdm;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (typeof jsonOdm === "undefined") {
if(typeof module === "undefined"){
jsonOdm = new JsonOdm();
}else{
jsonOdm = require('./odm');
jsonOdm = global.jsonOdm;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (typeof jsonOdm === "undefined") {
if(typeof module === "undefined"){
jsonOdm = new JsonOdm();
}else{
jsonOdm = require('./odm');
jsonOdm = global.jsonOdm;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (typeof jsonOdm === "undefined") {
if(typeof module === "undefined"){
jsonOdm = new JsonOdm();
}else{
jsonOdm = require('./odm');
jsonOdm = global.jsonOdm;
}
}

Expand Down

0 comments on commit 5eb9f6f

Please sign in to comment.