Created
July 7, 2016 08:44
-
-
Save karlpokus/f4bb07c0c4e064bb510a8946fa7b0a73 to your computer and use it in GitHub Desktop.
fongo in js - stub mongo for testing [WIP]
This file contains hidden or 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
// Like this -> https://github.com/fakemongo/fongo | |
// Based on this wrapper API from the shell | |
db[collectionName].query({selectors}, {projections}, cb(err, data)); | |
// Pass dummy data to constructor | |
var db = new Fongo({ | |
collections: [], | |
users: [ // should match to array above | |
{} // simple objects | |
] | |
}); | |
// With a little help from underscore? .find -> _.where() | |
// projections are a bitch >_< |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment