I am dealing with large json files on the client side. I want to be able to query the json in the same way I query mongo collections on the server side. I recently heard about minimongo which is exactly what I want. By the way, my backend is Flask and I'm using angular at the front-end. Can I use Minimongo as a simple javascript library without using the entire Meteor/Blaze framework ?
Unfortunately, you cannot just grab the minimongo directly from the meteor packages and have it work in the browser. There are a couple ways though.
There is a fork at https://www.npmjs.com/package/minimongo
This was forked back in Jan 2014.
If you need/want the latest from meteor, I also have a version that grabs in the latest minimongo, and builds/tests/browserifies using grunt scripts.
You can grab that from here: https://github.com/rurri/minimongo-standalone
I was able to get this working recently and was thrilled (by doing the well documented removing the meteor-base package, adding them all back individually, and then removing the mongo package).
The thing is theres no documentation on how to create the collection without using the new Mongo.Collection(null) syntax; so getting around that took a bit of peeking around in this file.
// New mongo-less syntax.
Faucets = new LocalCollection();
// Old Syntax
Faucets = new Mongo.Collection(null);
© 2022 - 2024 — McMap. All rights reserved.