Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
atlanteavila opened this issue Aug 15, 2016 · 0 comments

Comments

@atlanteavila
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant