Fork me on GitHub
This API is deprecated since version 1.3.0 and no longer available since version 1.3.1


An object that connects a Meteor Object to an AngularJS scope variable

This module has been deprecated in favor of the new helpers API.

There is no need for $meteor.object anymore as we can use Mongo Collection’s findOne function. Helpers will make sure to update Angular. We also removed autobind because it's a bad practice and we gain much better performance and easier maintainability both for the library and the apps developed with it.

Here is an example for how to migrate:

Old code:

$ = $meteor.object(Parties, $stateParams.partyId);

New Code:

  party() {
    return Parties.findOne($stateParams.partyId);


See $meteor.object


save( :doc );


Param Type Details Required
doc empty/ object

Document properties to save to the meteor object data.


If a document is passed, the method will compare between the document and the data, and will save the necessary changes into AngularMeteorObject. If no document argument is passed, the method saves all current data on the AngularMeteorObject, even unchanged properties will be overridden with their current values, hence hooks may be triggered on them. Returns a promise with value of 1 when successful (this is the number of docs successfully updated) or an error.


Reset the current value of the object to the one in the server.

subscribe( :subscriptionName );

A shorten (Syntactic sugar) function for the $meteor.subscribe function.

The function takes only one parameter and does not return a promise like $meteor.subscribe does.

When called after $scope.meteorObject, it acts the same but in addition it automatically closes the subscription when the scope is destroyed.


Param Type Details Required
subscriptionName subscriptionName

The subscription name to subscribe to. exactly like the first parameter in $meteor.subscribe service.





Returns a copy of the AngularMeteorObject with all the AngularMeteor-specific internal properties removed. The returned object is then safe to use as a parameter for method calls, or anywhere else where the data needs to be converted to JSON.




Stops watching the object for changes.


// Define a new Meteor Mongo Collection
Parties = new Mongo.Collection('parties');

// Define the Schema using aldeed:collection2 package for the Parties
PartySchema = new SimpleSchema({
  name: {
    type: String
  description: {
    type: String
  nameModified: {
    type: Date,
    autoValue: function() {
      if (this.field("name").isSet) {
        return new Date(); // automatically set nameModified with new Date only when name is modified
    denyInsert: true,
    optional: true


  doFancyStuff: function(party) {
    var id = party._id;
    // Do something fancy, like link with partygoers.

    party.description = "Set to fancy description!";

    delete party._id;

    Parties.update({_id: id}, {$set: { party }});

if (Meteor.isClient) {

  angular.module("socially").controller("PartyDetailsCtrl", ['$scope', '$stateParams', '$meteor',
    function($scope, $stateParams, $meteor){

      $ = $meteor.object(Parties, $stateParams.partyId);

      $scope.partyNotAuto = $meteor.object(Parties, $stateParams.partyId, false);

      $ = function(docs) {
          console.log('save success doc affected ', numberOfDocs);
        }, function(error){
          console.log('save error', error);

      // all values will be rewritten with their current values
      // nameModified will change

      // only description will change
      ${description: 'wine and cheese'})

      $scope.reset = function() {

      // Call a method that does fancy stuff to the object.
      $scope.callMethod = function() {
        $'doFancyStuff', $;