Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var db = require('./../utils/db');
var ottoman = require('ottoman');
ottoman.bucket = db.ODMBucket;
var Flight=require('./flight');
var UserMdl = ottoman.model('User', {
name: 'string',
password: 'string',
token:'string',
flights:'Mixed'
}, {
index: {
findByName: {
type: 'refdoc',
by: 'name'
}
}
});
UserMdl.prototype.addflights = function (newFlights, done) {
if (typeof this.flights.length === 'undefined') {
this.flights = [];
var db = require('./../utils/db');
var ottoman = require('ottoman');
ottoman.bucket = db.ODMBucket;
var FlightMdl = ottoman.model('Flight', {
name: 'string',
flight: 'string',
date:'string',
sourceairport:'string',
destinationairport:'string',
bookedon:'string'
});
module.exports=FlightMdl;