@@ -49,7 +49,8 @@ var schemaObject = {
4949
5050schemaObject . createdAt = {
5151 type : 'Date' ,
52- default : Date . now
52+ default : Date . now ,
53+ index : true
5354} ;
5455
5556schemaObject . updatedAt = {
@@ -59,12 +60,12 @@ schemaObject.updatedAt = {
5960
6061schemaObject . owner = {
6162 type : db . _mongoose . Schema . Types . ObjectId ,
62- ref : 'Users '
63+ ref : 'Accounts '
6364} ;
6465
6566schemaObject . createdBy = {
6667 type : db . _mongoose . Schema . Types . ObjectId ,
67- ref : 'Users '
68+ ref : 'Accounts '
6869} ;
6970
7071schemaObject . client = {
@@ -165,20 +166,20 @@ Schema.post('find', function(result) {
165166Schema . pre ( 'update' , function ( next ) {
166167
167168 // Indexing for search
168- var ourDoc = this . _update . $set ;
169- debug ( 'What we are updating: ' , ourDoc ) ;
170- ourDoc . model = collection ;
171- ourDoc . update = true ;
172- debug ( 'what do we have here: ' , ourDoc ) ;
173- if ( ourDoc . updatedAt || ourDoc . tags ) {
174- debug ( 'updatedAt: ' , ourDoc . updatedAt ) ;
175- debug ( 'tags: ' , ourDoc . tags ) ;
176- // Move along! Nothing to see here!!
177- } else {
178- // Dump it in the queue
179- queue . create ( 'searchIndex' , ourDoc )
180- . save ( ) ;
181- }
169+ var ourDoc = this . _update ;
170+ // debug('What we are updating: ', ourDoc);
171+ // ourDoc.model = collection;
172+ // ourDoc.update = true;
173+ // debug('what do we have here: ', ourDoc);
174+ // if(ourDoc.updatedAt || ourDoc.tags){
175+ // debug('updatedAt: ', ourDoc.updatedAt);
176+ // debug('tags: ', ourDoc.tags);
177+ // // Move along! Nothing to see here!!
178+ // }else{
179+ // // Dump it in the queue
180+ // queue.create('searchIndex', ourDoc)
181+ // .save();
182+ // }
182183 ourDoc . updatedAt = new Date ( Date . now ( ) ) . toISOString ( ) ;
183184 next ( ) ;
184185} ) ;
0 commit comments