This repository has been archived by the owner on Dec 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Craig Condon
committed
Apr 13, 2012
1 parent
f278085
commit 82b2ad9
Showing
39 changed files
with
327 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var Profile = new Schema({ | ||
comments: { ref: 'Comment' }, | ||
email: String, | ||
password: String | ||
}); | ||
|
||
|
||
var Comment = new Schema({ | ||
profile: { ref: 'Profile' }, | ||
title: String, | ||
message: String | ||
}); | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
var mdblite = require("../lib"), | ||
db = mdblite.db(new mdblite.drivers.Memory()); | ||
|
||
var helloCollection = db.collection("hello"); | ||
|
||
|
||
helloCollection.insert([ | ||
{ | ||
name: "Craig", | ||
age: 22 | ||
}, | ||
{ | ||
name: "Tim", | ||
age:21 | ||
}, | ||
{ | ||
name: "John", | ||
age:22 | ||
} | ||
]); | ||
|
||
setTimeout(function() { | ||
helloCollection.insert([ | ||
{ | ||
name: "Sarah", | ||
age: 22 | ||
} | ||
]); | ||
}, 1000); | ||
|
||
var cursor = helloCollection.find({age:{$gt:21}}); | ||
|
||
cursor.on("insert", function(item) { | ||
console.log("new item added!"); | ||
console.log(item) | ||
}); | ||
|
||
|
||
|
||
|
||
cursor.each(function(err, item) { | ||
if(item) console.log(item); | ||
}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
module.exports = { | ||
_abstract: function() { | ||
throw new Error("Not implemented"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var structr = require("structr"); | ||
|
||
module.exports = structr(require("./abstract"), { | ||
|
||
/** | ||
*/ | ||
|
||
connect: function() { | ||
this._abstract(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.