This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this is used on a toggleChild function to add or remove mongo child relationships | |
//it works fine when for $pull but $addToSet doesn't ever seem to get sent to the server | |
if(window[Meteor.request.controller.capitalise()]["find"](query).count() == 0){ | |
children[child_collection_name] = child; | |
modifiers['$addToSet'] = children; | |
modifiers['$set'] = { client_updated: ts }; | |
} else if (window[Meteor.request.controller.capitalise()]["find"](query).count() == 1){ | |
children[child_collection_name] = child; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//all of this is client side | |
//some of the concept is taken from | |
//http://stackoverflow.com/questions/10167464/meteor-rendering-template-with-a-document-from-a-collection/10167515#comment13990810_10167515 | |
//collection setup | |
myCollection = new Meteor.Collection('myCollection'); | |
//subscription is working | |
//the entire contents render perfectly in a template that shows all records | |
//it shows changes made server side or client side |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var key = CryptoJS.AES.encrypt('test', 'password'); | |
console.log('key: ' + key); | |
id = MyCollection.insert({ | |
created: new Date(), | |
expires: expires, | |
key: key | |
}, function(error, result){ | |
console.log('error: ' + error); | |
console.log('result: ' + error); | |
}); |
NewerOlder