Closed alexdmejias closed 9 years ago
You're adding the properties in Javascript objects in memory, where you should be editing them in the database.
The best thing to do would be to modify the docs before, so that you don't do two database operations for each document.
is it possible to only attach the properties whenever they are requested? as opposed to saving them to the DB
I don't understand what you mean by "whenever they are requested". I think you might be looking for the transform
option of a collection, which is not the same thing as what this package is providing.
It sounds like you're looking to transform your doc. See http://docs.meteor.com/#/full/find and look for transform
yup, looks like I was referring to transform
I'm trying to use collections-hooks to attach properties to each document on before or after(I'm not sure which one I should be using) but I can't seem to be able to return an array with the new properties. I did have success with
findOne
If I use something like
a
testAfter
property is added to my document. The closest that I have gotten to getting this to work is to do something likeBut when I check at the resulting api (using Restivus) nothing is attached (new properties are attaching when using findOne)