Emitting a Backbone.js Model through Socket.io

BASIC QUESTION
I am trying to send an object through socket.emit() but the object is not being fully sent. I may just be misunderstanding how to do this, but here's the example:

console.log(object)

RESULTS IN

{ length: 8,
  models:
   [ { attributes: [Object],
       _escapedAttributes: {},
       cid: 'c1',
       changed: {},
       _silent: {},
       _pending: {},
       _previousAttributes: [Object],
       lots: [Object],
       _changing: false,
       collection: [Circular],
       _callbacks: [Object] },
    ... ETC

While

socket.emit(e,object);

RESULTS IN :

{"name":"read:AllAuctions","args":
[[{"auctionId":"298"},{"auctionId":"381"},{"auctionId":"385"},
{"auctionId":"393"},{"auctionId":"394"},{"auctionId":"395"},
{"auctionId":"402"},{"auctionId":"800"}]]}

It arrives to the front-end in the latter format.

WAY MORE DETAIL
I've created a server that is attempting to update a client-side backbone model using socket.io. Some of it is using the ideas specified here:

http://developer.teradata.com/blog/jasonstrimpel/2011/11/backbone-js-and-socket-io

The difference is that I've created backbone models on the back end. My logic was to share the basic model files, and have the back-end deal with communicating with the persistance layer and keeping the "true" data source optimized, but then respond to requests to fetch those models/collections as well as automatically pushing updates.

Everything seems to be working except for however I'm supposed to transfer the model to the front-end. Do I need to extend/overwrite toJSON or another method that actually converts it for transport? If so, how do I do that? Any help you can give me would be greatly appreciated!

I think you should only sent the data and recreate the object on the client-side.

Therefor you could try using Backbone Collection's toJSON

socket.emit(e, object.toJSON());

Before sending use JSON.stringify and deserialize on the other end with JSON.parse

I hate to answer my own question, but I found the problem in another question: Saving Backbone model and collection to JSON string

Essentially, what I didn't realize was that toJSON() only returns the attributes of the model. My models contained a collection of other models, so I needed to overwrite toJSON().

Collections call the toJSON() of their child model. So, I ultimately needed to change the model's toJSON function to return the attributes AND the collection of models they contained.

Here's the example:

var Auction = Backbone.Model.extend({
  defaults: {
    auctionId : null
  },
  toJSON : function() {
    var returnObject = {};
    returnObject["auctionId"] = this.get("auctionId");
    returnObject["lots"] = this.lots;
    return returnObject;
  },
  initialize : function() {
    this.lots = new Lots;
  }
});

Please note in my example that rather than returning all attributes of the model, I'm just returning the attribute "auctionId." This to me seemed safer because another developer here might later add attributes that do not need to be transported. That being said, it's probably better practice to make an element of the returnObject contain all the attributes. This just made my re-building of the model on the client-side a little easier.