-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdb.js
56 lines (46 loc) · 1021 Bytes
/
db.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var mongoose = require( 'mongoose' );
var Schema = mongoose.Schema;
var customer = new Schema({
Name : String,
Pwd : String,
updated_at : Date,
items:Array,
status:Array
});
var books = new Schema({
unq_id : String,
Name:String,
min_cost : Number,
Dept:String,
Sem:Number,
Title:String,
Author:String,
Desc : String,
Posted: Date,
Academic: Boolean,
Genre:String
});
var cycles = new Schema({
user_id : String,
name: String,
min_cost : Number,
Desc : String,
Posted: Date,
Brand: String,
Type:String,
Color:String
});
var electronics = new Schema({
user_id : String,
name: String,
min_cost : Number,
Desc : String,
Posted: Date,
Brand: String,
Item:String
});
// mongoose.model( 'Profile', profile );
mongoose.model( 'books', books );
mongoose.model( 'cycles', cycles );
mongoose.model( 'customer', customer );
mongoose.connect( 'mongodb://localhost/sellbuy' );