These are chat archives for Automattic/mongoose

6th
Jan 2017
Paul "Joey" Clark
@joeytwiddle
Jan 06 2017 03:45
Maybe. Please just ask your question.
Dustin Hoffmann
@dustintheweb
Jan 06 2017 17:04

I've got a simple user schema going that looks like the following:

const session = new Schema({
    referrer: [referrer],
    user: [session_user_data],
    usage: [session_usage_data]
});

const sessions = new Schema({
    session: [session],
    _id: false
});

const userSchema = new Schema({
    profile: [profile],
    sessions: [sessions]
});

In the client app, when I post to Mongo via the api, I would like to ensure that an individual "session" is created each time and stored as ecpected. Is this correct?

I believe I am missing something...