Permalink
Browse files

Renamed "Util" to support, to avoid confusion

  • Loading branch information...
1 parent e2de9ab commit 662dabf68a1fe1ad7cf90fe6d8035a52cffc8fd9 @sergi committed Apr 15, 2010
Showing with 12 additions and 12 deletions.
  1. +7 −7 lib/collection.js
  2. +4 −4 lib/cursor.js
  3. +1 −1 lib/mongodb.js
View
@@ -1,4 +1,4 @@
-var Util = require("mongosupport").MongoSupport;
+var Support = require("mongosupport").MongoSupport;
var Cursor = require("cursor").Cursor;
function Collection(collection, db) {
@@ -73,7 +73,7 @@ Collection.prototype = {
}
}
else {
- Util.extend(ret, options);
+ Support.extend(ret, options);
}
break;
default:
@@ -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));
@@ -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();
@@ -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
@@ -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);
},
View
@@ -1,4 +1,4 @@
-var Util = require("mongosupport").MongoSupport;
+var Support = require("mongosupport").MongoSupport;
function Cursor(cursor) {
this.cursor = cursor;
@@ -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));
@@ -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();
View
@@ -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;

0 comments on commit 662dabf

Please sign in to comment.