Skip to content

Instantly share code, notes, and snippets.

@karlpokus
Created July 7, 2016 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlpokus/f4bb07c0c4e064bb510a8946fa7b0a73 to your computer and use it in GitHub Desktop.
Save karlpokus/f4bb07c0c4e064bb510a8946fa7b0a73 to your computer and use it in GitHub Desktop.
fongo in js - stub mongo for testing [WIP]
// 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