node-restful icon indicating copy to clipboard operation
node-restful copied to clipboard

Is there a simple way to push objects to a schema that uses an array as it's type

Open atlanteavila opened this issue 9 years ago • 0 comments

Hello,

I love this library and I've only begun to work with it. I'm in a tight deadline at school and I've been tasked with creating a messaging system in our app. I want my users to be able to send each other messages. Each message will come in as an object and be pushed to the user's messages field which is set to be an array:

var ownerSchema = new mongoose.Schema({ firstName: String, lastName: String, age: Number, location: String, favorite: String, numberOfBreeds: Number, numberOfDogs: Number, messages: [] // <== this is the array I'm trying to push messages to });

I'm trying to figure out how to use your library to accomplish something like this. I appreciate any time you give to answering this question. Thanks!

atlanteavila avatar Aug 15 '16 00:08 atlanteavila