Tutorial by Examples

You can default to the normal Mongo format by defining your collections with the idGeneration field. MyCollection = new Meteor.Collection('mycollection', {idGeneration : 'MONGO'});
Many beginners to Mongo struggle with basics, such as how to insert an array, date, boolean, session variable, and so forth into a document record. This example provides some guidance on basic data inputs. Todos.insert({ text: "foo", // String listId: Session...
You can get it either synchronously: var docId = Todos.insert({text: 'foo'}); console.log(docId); Or asynchronously: Todos.insert({text: 'foo'}, function(error, docId){ console.log(docId); });
Using MongoDB for time series data is a very well document and established use-case, with official whitepapers and presentations. Read and watch the official documentation from MongoDB before trying to invent your own schemas for time series data. MongoDB for Time Series Data In general, you'll w...
Simple pattern for filtering subscriptions on the server, using regexes, reactive session variables, and deps autoruns. // create our collection WordList = new Meteor.Collection("wordlist"); // and a default session variable to hold the value we're searching for Session.setDefault('...
Geospatial collections generally involve storing GeoJSON in the Mongo database, streaming that data to the client, accessing the browser's window.navigator.geolocation, loading up a Map API, converting GeoJSON to LatLngs, and plotting on the map. Preferably all in realtime. Here are a list of reso...
The following example will log all of your collection queries to the server console in realtime. Meteor.startup( function () { var wrappedFind = Meteor.Collection.prototype.find; // console.log('[startup] wrapping Collection.find') Meteor.Collection.prot...
If the Node event loop acts like a bicycle chain, the server-side collection observer is like a derailleur. It's a gearing mechanism that is going to sit on the data collection as the data comes in. It can be very performant, as all race bicycles have derailleurs. But it's also a source for breaking...

Page 1 of 1