notes /bookmarks.js

Language Javascript Lines 135
MD5 Hash 5c30fb06bbe19beda9404cf95929b34f
Repository https://github.com/saquib2527/notes.git View Raw File View Project SPDX
| Open JSFiddle
  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
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
db.users.drop()
db.links.drop()

db.users.insert({
	name: { first: "John", last: "Doe" },
	age: 30,
	email: "johndoe@gmail.com",
	passwordHash: "some_password_hash",
	logins: [
		{ at: new Date(2012, 3, 4, 5, 6, 7), minutes: 20 },
		{ at: new Date(2012, 3, 15, 16, 17, 18), minutes: 18 },
		{ at: new Date(2012, 4, 1, 2, 3, 4), minutes: 34 },
	]
});
db.users.insert({
	name: { first: "Jane", last: "Wilson" },
	age: 25,
	email: "janewilson@gmail.com",
	passwordHash: "another_password_hash",
	logins: [
		{ at: new Date(2012, 5, 6, 7, 8, 9), minutes: 21 },
		{ at: new Date(2012, 5, 16, 17, 18, 19), minutes: 50 }
	]
});
db.users.insert({
	name: { first: "Bob", last: "Smith" },
	age: 31,
	email: "bob.smith@gmail.com",
	passwordHash: "last_password_hash",
	logins: [
		{ at: new Date(2012, 2, 3, 4, 5, 6), minutes: 59 },
		{ at: new Date(2012, 3, 3, 4, 5, 6), minutes: 20 }
	]
});

var u1 = db.users.findOne({ 'name.first': 'John' }),
    u2 = db.users.findOne({ 'name.first': 'Jane' }),
	u3 = db.users.findOne({ 'name.first': 'Bob' });

db.links.insert({
	title: 'Nettuts+',
	url: 'http://net.tutsplus.com',
	comment: 'Great site for web dev tutorials',
	tags: ['tutorials', 'dev', 'code'],
	favorites: 100,
	userId: u1._id
});
db.links.insert({
	title: 'Psdtuts+',
	url: 'http://psd.tutsplus.com',
	comment: 'Photoshop tutorials like no other',
	tags: ['photoshop', 'tutorials'],
	favorites: 507,
	userId: u2._id
});
db.links.insert({
	title: 'Tuts+ Premium',
	url: 'http://tutsplus.com',
	comment: 'The best screencast courses ever',
	tags: ['screencasts', 'tutorials'],
	favorites: 149,
	userId: u1._id
});
db.links.insert({
	title: 'Envato',
	url: 'http://envato.com',
	comment: 'Greatest company in Australia',
	tags: ['business', 'australia'],
	favorites: 279,
	userId: u2._id
});
db.links.insert({
	title: 'MongoDB.org',
	url: 'http://mongodb.org',
	comment: 'Really cool NoSQL database',
	tags: ['database', 'development'],
	favorites: 79,
	userId: u3._id
});
db.links.insert({
	title: 'Audible Audio Books',
	url: 'http://www.audible.com',
	comment: 'Good audio books',
	tags: ['books', 'audio'],
	favorites: 100,
	userId: u2._id
});
db.links.insert({
	title: 'Wikipedia',
	url: 'http://wikipedia.org',
	comment: 'The source of all knowledge',
	tags: ['information', 'encyclopedia', 'online', 'wikis'],
	favorites: 187,
	userId: u3._id
});
db.links.insert({
	title: 'Mobiletuts+',
	url: 'http://mobile.tutsplus.com',
	comment: 'Great tutorials for developing on mobile devices',
	tags: ['mobile', 'development'],
	favorites: 84,
	userId: u2._id
});
db.links.insert({
	title: 'Amazon.com',
	url: 'http://www.amazon.com',
	comment: 'Where to buy things',
	tags: ['selling', 'buying'],
	favorites: 329,
	userId: u1._id
});
db.links.insert({
	title: 'ThemeForest',
	url: 'http://themeforest.net',
	comment: 'Where to buy the best website themes',
	tags: ['marketplace', 'themes'],
	favorites: 654,
	userId: u1._id
});
db.links.insert({
	title: 'CodeCanyon',
	url: 'http://codecanyon.net',
	comment: 'A marketplace for code',
	tags: ['marketplace', 'code'],
	favorites: 217,
	userId: u2._id
});
db.links.insert({
	title: 'GraphicRiver',
	url: 'http://graphicriver.net',
	comment: 'A marketplace for graphics',
	tags: ['marketplace', 'graphics'],
	favorites: 543,
	userId: u3._id
});
Back to Top