You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ subjects.insert(subject2) // insert billy
78
78
79
79
subjects.remove(["_id": subject1.id!]) // remove dan
80
80
81
-
subjects.update(query: ["name":"Billy"], data: subject1, type: .Basic) // replace billy with dan
81
+
subjects.update(query: ["name":"Billy"], document: subject1, type: .Basic) // replace billy with dan
82
82
83
83
let results = subjects.find(["age":15]) // find all people aged 15 (dan)
84
84
@@ -91,7 +91,7 @@ switch results {
91
91
case .Success(let testSubjects):
92
92
print(testSubjects)
93
93
for testSubject in testSubjects {
94
-
testSubject.printSelf()
94
+
print(testSubject.data)
95
95
}
96
96
97
97
case .Failure(let err):
@@ -101,6 +101,8 @@ case .Failure(let err):
101
101
102
102
```
103
103
104
+
For some more examples, I would take a look at the test suite (most of the main operations are tested).
105
+
104
106
# Tutorial
105
107
106
108
This example assumes that you have setup the project and have MongoDB running.
@@ -249,7 +251,7 @@ or only remove those whose name is Dan, for example, with:
249
251
subjects.remove(["name":"Dan"])
250
252
```
251
253
252
-
That's about it for now! More operations will be supported in the future.
254
+
More operations are supported, but I think at this point you get the gist of it. Take a look at the block of code above for some more examples, and then take a look at the test suite if you want even more information.
253
255
254
256
255
257
# Features
@@ -271,4 +273,6 @@ Ideally I would like to mirror all of the features that the Mongo Shell offers,
271
273
# Contributing
272
274
Any and all help is very welcome! Feel free to fork and submit a pull request - I will almost certainly merge it.
273
275
274
-
You should start by looking at the [trello board](https://trello.com/b/FT2OCCjQ/swiftmongodb) and see if there's anything you want to implement there. You can also create feature requests.
276
+
You should start by looking at the [trello board](https://trello.com/b/FT2OCCjQ/swiftmongodb) and see if there's anything you want to implement there. You can also create feature requests.
277
+
278
+
There's also a test suite included in the xcode project - so far the coverage isn't too good but it will get better, I promise.
0 commit comments