Skip to content

Commit

Permalink
Renamed "Util" to support, to avoid confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
sergi committed Apr 15, 2010
1 parent e2de9ab commit 662dabf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions lib/collection.js
@@ -1,4 +1,4 @@
var Util = require("mongosupport").MongoSupport;
var Support = require("mongosupport").MongoSupport;
var Cursor = require("cursor").Cursor;

function Collection(collection, db) {
Expand Down Expand Up @@ -73,7 +73,7 @@ Collection.prototype = {
}
}
else {
Util.extend(ret, options);
Support.extend(ret, options);
}
break;
default:
Expand All @@ -97,7 +97,7 @@ Collection.prototype = {
var args = Array.prototype.slice.call(arguments)
.map(function(arg) {
return typeof arg == "object" ?
Util.createBDObject(arg) : arg;
Support.createBDObject(arg) : arg;
});

return new Cursor(this.collection.find.apply(this.collection, args));
Expand All @@ -111,7 +111,7 @@ Collection.prototype = {
if (obj && typeof(obj) != "object")
dbo = { "_id": obj };

var sm = this.collection.findOne(Util.createBDObject(dbo), Util.createBDObject(arguments[1]));
var sm = this.collection.findOne(Support.createBDObject(dbo), Support.createBDObject(arguments[1]));
if (sm) {
var jsObj = {__proto__: null},
smKeySet = sm.keySet().toArray();
Expand All @@ -122,9 +122,9 @@ Collection.prototype = {
return null;
},
save: function(obj) {
var dbo = Util.createBDObject(obj);
var dbo = Support.createBDObject(obj);
var sm = this.collection.save(dbo) || {};
return Util.ensureStringId(sm);
return Support.ensureStringId(sm);
},
/**
* Using the JavaScript way instead of the Java method because the latter
Expand Down Expand Up @@ -159,7 +159,7 @@ Collection.prototype = {
},
insert: function(docs) {
var insertable = docs.isArray && docs.isArray() ?
docs.map(Util.createBDObject) : Util.createBDObject(docs);
docs.map(Support.createBDObject) : Support.createBDObject(docs);

this.collection.insert(insertable);
},
Expand Down
8 changes: 4 additions & 4 deletions lib/cursor.js
@@ -1,4 +1,4 @@
var Util = require("mongosupport").MongoSupport;
var Support = require("mongosupport").MongoSupport;

function Cursor(cursor) {
this.cursor = cursor;
Expand Down Expand Up @@ -28,7 +28,7 @@ Cursor.prototype = {
cursor: null,
next: function() {
var sm = this.cursor.next() || {};
return Util.ensureStringId(sm);
return Support.ensureStringId(sm);
},
limit: function(lim) {
return new Cursor(this.cursor.limit(lim));
Expand All @@ -37,14 +37,14 @@ Cursor.prototype = {
return new Cursor(this.cursor.skip(num));
},
sort: function(obj) {
return new Cursor(this.cursor.sort(Util.createBDObject(obj)));
return new Cursor(this.cursor.sort(Support.createBDObject(obj)));
},
explain: function() {
return this.cursor.explain() || {};
},
toArray: function() {
var obj = this.cursor.copy().toArray().toArray();
return obj.map(function(el) { return Util.ensureStringId(el) }).slice();
return obj.map(function(el) { return Support.ensureStringId(el) }).slice();
},
snapshot: function() {
this.cursor.snapshot();
Expand Down
2 changes: 1 addition & 1 deletion lib/mongodb.js
@@ -1,4 +1,4 @@
var Util = require("mongosupport").MongoSupport;
var Support = require("mongosupport").MongoSupport;
var BasicDBObject = Packages.com.mongodb.BasicDBObject;
var Cursor = require("cursor").Cursor;
var Collection = require("collection").Collection;
Expand Down

0 comments on commit 662dabf

Please sign in to comment.