Skip to content

Commit 9115569

Browse files
unknownunknown
authored andcommitted
Changes to migrate to a meteor server
1 parent 1957909 commit 9115569

File tree

875 files changed

+20
-151860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

875 files changed

+20
-151860
lines changed

LICENSE

Lines changed: 0 additions & 202 deletions
This file was deleted.

README.md

Lines changed: 20 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,20 @@
1-
# ocpmeta
2-
LIMS system
3-
4-
5-
#Instructions
6-
mongoDB cmd line instructions:
7-
8-
Viewing is super duper easy
9-
10-
`db.kki42.find()` means use the current db, collection kki42, find everything
11-
`db.kki42.find({_id:5})` use current db, collection kki42, find document where `_id = 5`
12-
13-
using `.pretty()` on the end makes it much more readable, btw
14-
15-
Deleting is easy too.
16-
17-
`db.kki42.remove({_id:5})` removes document where `_id = 5` from current db, collection kki42
18-
19-
`db.kki42.remove()` REMOVES EVERYTHING so DON'T do this - but note that it won't remove the collection, just all the data inside (kind of useless)
20-
if you want to remove the collection, use `db.kki42.drop()` instead. you'll get a "true" once it's done.
21-
22-
23-
Updating is kind of a pain in the butt. It's easy to overwrite a document if you forget to use the $set command:
24-
25-
1. to add a field:
26-
```
27-
db.kki42.update({_id:5},{$set:{"test_field":"hello world!"})
28-
```
29-
this will add "test_field to the document
30-
31-
be aware that without the $set command:
32-
```
33-
db.kki42.update({_id:5},{"test_field":"hello world!"})
34-
```
35-
will overwrite everything in document where _id = 5 and put the red stuff as the new value
36-
37-
2. to remove a field:
38-
```
39-
db.kki42.update({_id:5},{$unset:{"test_field":""})
40-
```
41-
this will remove "test_field" from the document where _id = 5
42-
43-
3. to update multiple documents:
44-
have to use the $multi command:
45-
46-
```
47-
db.kki42.update({age:30}, {$set:{"test_field":"hello world!"}},{$multi:true})
48-
```
49-
50-
4. to insert on update if no match found:
51-
```
52-
db.kki42.update({age:30}, {$set:{"test_field":"hello world!"}},{$upsert:true})
53-
```
54-
55-
This will insert a new document if none that matches your criteria are found. Useful for data tracking over time.
1+
Old express.js version can be found in the old_version directory
2+
3+
Full setup from scratch, to running this service (on Ubuntu):​
4+
5+
```
6+
​​​sudo apt-get install nodejs
7+
wget https://install.meteor.com | sh
8+
git clone [email protected]:j6k4m8/ocpmeta.git ocpmeta
9+
cd ocpmeta
10+
meteor --port=3030
11+
​```
12+
13+
Endpoints:
14+
'/api/metadata/get/:id'
15+
'/api/metadata/delete/:id/'
16+
'/api/metadata/unset/:id/:field_name'
17+
'/api/metadata/set/:id/:field_name'
18+
'/api/metadata/exists/:field_name'
19+
'/api/metadata/get'
20+
'/api/metadata/set'

0 commit comments

Comments
 (0)