How to use the SchemaTypes function from mongoose
Find comprehensive JavaScript mongoose.SchemaTypes code examples handpicked from public code repositorys.
4 5 6 7 8 9 10 11 12 13 14
* Defines the schema of the payment resource to be stored in the DB */ const paymentSchema = new mongoose.Schema({ bookingId: { type: mongoose.SchemaTypes.ObjectId, required: true, ref : "Booking" }, amount: {
3
2
0
0 1 2 3 4 5 6 7 8 9 10
const mongoose = require('mongoose'); const deckSchema = new mongoose.Schema({ deckName: mongoose.SchemaTypes.Mixed, format: String, formatVersion: mongoose.SchemaTypes.Mixed, url: mongoose.SchemaTypes.Mixed, cards: [mongoose.SchemaTypes.Mixed] });
0
1
0
+ 2 other calls in file
13 14 15 16 17 18 19 20 21 22
giveawayEnded: String, inviteToParticipate: String, drawing: String, dropMessage: String, winMessage: mongoose.SchemaTypes.Mixed, embedFooter: mongoose.SchemaTypes.Mixed, noWinner: String, winners: String, endedAt: String, hostedBy: String
0
0
1
+ 23 other calls in file
37 38 39 40 41 42 43 44 45 46
type: String }, workouts: [{ date: String, rows: [{ id: mongoose.SchemaTypes.ObjectId, exer: String, set1: Number, set2: Number, set3: Number,
0
0
0
9 10 11 12 13 14 15 16 17 18
type: { type: "String", enum: ["veg", "nonVeg", "veg&NonVeg"] }, cuisine: { type: String, }, rating: { type: mongoose.SchemaTypes.Decimal128, default: 0, }, reviews: [ {
0
0
0
mongoose.model is the most popular function in mongoose (2160 examples)