-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.js
64 lines (59 loc) · 1.34 KB
/
database.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
57
58
59
60
61
62
63
64
// Temporary Database
// Array of objects
// Documents in MongoDB have no structure restrictions.
// Documents work similar to JSON format in mongoDB.
// Documents have a key value pair (similar to JSON).
// No specific schema required before hand line SQL database.
// SO structuring the data is easier in mongoDB
let Book = [
{
ISBN: "12345ONE",
title: "Getting started with MERN",
authors: [1, 2],
language: "en",
pubDate: "2021-07-07",
numOfPage: 225,
category: ["fiction", "programming", "tech", "web dev"],
publication: 1,
},
{
ISBN: "12345Two",
title: "Getting started with Python",
authors: [1],
language: "en",
pubDate: "2021-07-07",
numOfPage: 225,
category: ["fiction", "tech", "web dev"],
publication: 1,
},
];
let Author = [
{
id: 1,
name: "pavan",
books: ["12345ONE", "12345Two"],
},
{
id: 2,
name: "Deepak",
books: ["12345ONE"],
},
{
id: 3,
name: "Aditya",
books: [],
},
];
let Publication = [
{
id: 1,
name: "Chakra",
books: ["12345ONE"],
},
{
id: 2,
name: "Vickie Publications",
books: [],
},
];
module.exports = { Book, Author, Publication };