     @_versionFrequency = config.versionFrequency
 
   makeSnapshotOf: (aggregate) ->
-    id = aggregate.getId()
+    id = aggregate.getId().toString()
     currentVersion = aggregate.getVersion()
     data = @_collection.findOne _id: id
 

class Space.eventSourcing.Snapshotter extends Space.Object

  _collection: null
  _versionFrequency: 0

      @_collection.insert _id: id, snapshot: aggregate.getSnapshot()

  getSnapshotOf: (Type, id) ->
    id = id.toString()
    record = @_collection.findOne(_id: id)
    if record?
      return Type.createFromSnapshot record.snapshot
    else
      throw @ERRORS.noSnapshotFound(id)
