forked from twyrostek/4320FinalProjGroup9
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdated commands.txt
275 lines (261 loc) · 7.41 KB
/
updated commands.txt
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
//Creates and switches to our MongoDB entitled "ocdx"
>use ocdx
switched to db ocdx
//Creates the collection in our database called "manifest"
> db.createCollection("manifest")
{ "ok" : 1 }
//Creation and insertion of the dummy data in our database
> db.manifest.insert({
... "manifests": {
... "manifest": {
... "standardVersions": "ocdxManifest schema v.1",
... "id": "https: //datahub.io/dataset/teahouse-corpus",
... "creator": "Kristen Schuster",
... "dateCreated": "2016 - 20 - 04",
... "comment": "This is an example OCDX manifest created by Krsiten Schuster",
... "researchObject": {
... "title": "Teahouse Corpus",
... "abstract": "The Teahouse corpus is aset of questions asked at the Wikipedia Teahouse, a peer support forum for new Wikipedia editors.This corpus contains data from its first two years of operation.",
... "dates": {
... "date": {
... "date": "2012 - 02 - 27",
... "label": "start"
... }
... }
... },
... "privacyEthics": {
... "oversight": {
... "label": "No assertion"
... }
... },
... "informedConsent": "No assertion",
... "anonymizedData": {
... "label": "No assertion"
... },
... "privacyConsiderations": "No assertion"
... },
... "provenance": {
... "narrative": "The Teahouse started as an editor engagement initiative and Fellowship project.It was launched in February 2012 by a small team working with the Wikimedia Foundation.Our intention was to pilot a new, scalable model for teaching Wikipedia newcomers the ropes of editing in a friendly and engaging environment. The ultimate goal of the pilot project was to increase the retention of new Wikipedia editors(most of whom give up and leave within their first 24 hours post - registration) through early proactive outreach.The project was particularly focused on retaining female newcomers, who are woefully underrepresented among the regular contributors to the encyclopedia."
... },
... "publications": {
... "publication": "No assertion"
... },
... "locations": {
... "location": {
... "url": "",
... "comment": ""
... }
... },
... "files": {
... "file": {
... "name": "teahouse - questions20140223.csv"
... },
... "format": ".csv",
... "abstract": "Metadata for 5,003 questions",
... "size": "No assertion",
... "url": "No assertion",
... "checksum": "No assertion"
... },
... "permissions": "No assertion"
... },
... "dates": {
... "date": {
... "date": "2014 - 02 - 15"
... },
... "label": "Created"
... },
... "creators": {
... "creator": {
... "name": "Jonathan Morgan",
... "role": {
... "label": "Other"
... }
... },
... "type": {
... "label": "No assertion"
... },
... "contact": "[email protected]"
... }
... })
WriteResult({ "nInserted" : 1 })
> db.manifest.insert({
... "manifests": {
... "manifest": {
... "standardVersions": "ocdxManifest schema v.1",
... "id": "https: //datahub.io/dataset/teahouse-corpus",
... "creator": "Eric Forman",
... "dateCreated": "1977 - 20 - 04",
... "comment": "This is an example OCDX manifest created by Eric Forman",
... "researchObject": {
... "title": "Reddit",
... "abstract": "Reddit is a online forum with a lot of pictures of cats.",
... "dates": {
... "date": {
... "date": "2006 - 05 - 13",
... "label": "start"
... }
... }
... },
... "privacyEthics": {
... "oversight": {
... "label": "No assertion"
... }
... },
... "informedConsent": "No assertion",
... "anonymizedData": {
... "label": "No assertion"
... },
... "privacyConsiderations": "No assertion"
... },
... "provenance": {
... "narrative": "Reddit is where everyone's time goes to die. I've spent over 1000 hours looking at pictures of cats on it. Oh an I have also learned a lot about memes. I'm a master memer."
... },
... "publications": {
... "publication": "No assertion"
... },
... "locations": {
... "location": {
... "url": "",
... "comment": ""
... }
... },
... "files": {
... "file": {
... "name": "reddit-cats.csv"
... },
... "format": ".csv",
... "abstract": "Metadata for 4,325 picures of cats",
... "size": "No assertion",
... "url": "No assertion",
... "checksum": "No assertion"
... },
... "permissions": "No assertion"
... },
... "dates": {
... "date": {
... "date": "20105 - 06 - 15"
... },
... "label": "Created"
... },
... "creators": {
... "creator": {
... "name": "Steven Hyde",
... "role": {
... "label": "Other"
... }
... },
... "type": {
... "label": "No assertion"
... },
... "contact": "[email protected]"
... }
... })
> db.manifest.insert({
... "manifests": {
... "manifest": {
... "standardVersions": "ocdxManifest schema v.1",
... "id": "https: //datahub.io/dataset/teahouse-corpus",
... "creator": "Chris King",
... "dateCreated": "2016 - 31 - 10",
... "comment": "This is an example OCDX manifest created by Chris King",
... "researchObject": {
... "title": "Jokes",
... "abstract": "This contains a lot of Halloween Jokes.",
... "dates": {
... "date": {
... "date": "1999 - 31 - 12",
... "label": "start"
... }
... }
... },
... "privacyEthics": {
... "oversight": {
... "label": "No assertion"
... }
... },
... "informedConsent": "No assertion",
... "anonymizedData": {
... "label": "No assertion"
... },
... "privacyConsiderations": "No assertion"
... },
... "provenance": {
... "narrative": "No one has ever compiled a complete and comprehensive set of Halloween jokes before. Until Now. This data set contains the best one-liners, knock-knock jokes, dumb blonde jokes, and anti-jokes you've ever read. "
... },
... "publications": {
... "publication": "No assertion"
... },
... "locations": {
... "location": {
... "url": "",
... "comment": ""
... }
... },
... "files": {
... "file": {
... "name": "jokes.csv"
... },
... "format": ".csv",
... "abstract": "Metadata for 14,550 bogus jokes",
... "size": "No assertion",
... "url": "No assertion",
... "checksum": "No assertion"
... },
... "permissions": "No assertion"
... },
... "dates": {
... "date": {
... "date": "2010 - 15 - 06"
... },
... "label": "Created"
... },
... "creators": {
... "creator": {
... "name": "Chris King",
... "role": {
... "label": "Other"
... }
... },
... "type": {
... "label": "No assertion"
... },
... "contact": "[email protected]"
... }
... })
//Updates the document in collection manifest whose title is Reddit to ocdx
db.manifest.update(
{"manifests.manifest.researchObject.title" : "Reddit"},{$set: {"manifests.manifest.researchObject.title" : "ocdx"}})
//Deletes one document with the creator Kristen Schuster
db.manifest.deleteOne({"manifests.manifest.creator" : "Kristen Schuster"})
// Creates the user collection in our ocdx database
db.createCollection("user")
//Inserts a document into the user collection
db.user.insert({
"user_id": "18132351",
"name": "Jon Doe",
"userName": "JDoe",
"pw" : "eggsandbac0n",
"salt": "asdfeu2435cx9pq4htqwvr",
"hashpw": "q83ryaldfhaoiw37traobvsdf",
"user_type": "researcher",
"is_admin" : "yes",
"email": "[email protected]",
"location": "Columbia, MO"
})
//Updates the email of a document in the user collection that has a name of Jon Doe
db.user.update({"name": "Jon Doe"},{$set: {"email" : "[email protected]"}})
//Deletes the user whose name is Samuel Brown
db.user.deleteOne({"name" : "Samuel Brown"})
//Creates the log collection
db.createCollection("log")
//Inserts a document into the log collection
db.log.insert({
"user_id": "18132352",
"timestamp" : new Date(),
"action": "login",
"pass_fail": "pass"
})
//Updates the pass_fail field of document with user id of 18132352
db.log.update({"user_id": "18132352"},{$set: {"pass_fail" : "fail"}})
//Deletes the log with the specified _id
db.log.deleteOne({"_id" : ObjectId("58267faffdc91c910a02f280")})