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: {
fork icon3
star icon2
watch icon0

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]
});

fork icon0
star icon1
watch icon0

+ 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
fork icon0
star icon0
watch icon1

+ 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,
fork icon0
star icon0
watch icon0

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: [
  {
fork icon0
star icon0
watch icon0