Skip to content

Instantly share code, notes, and snippets.

@BassOfBass
Created November 25, 2020 07:51
Show Gist options
  • Save BassOfBass/411992b45c57933b850b3e9135da0a3a to your computer and use it in GitHub Desktop.
Save BassOfBass/411992b45c57933b850b3e9135da0a3a to your computer and use it in GitHub Desktop.
Invite model
Invite {
code: String,
expirationDate: Date,
usesLeft: Number,
/**
* The person creating the invite.
*/
creator: {
type: Schema.Types.ObjectId,
ref: "User"
},
/**
* All users who entered the invite.
*/
guests: [{
type: Schema.Types.ObjectId,
ref: "User"
}],
}, { timestamps: true }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment