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
+18-19
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
-
# Lint
1
+
# Fawn
2
2
## Library for atomic-ish operations in MongoDB
3
3
4
-
Lint provides the ability to carry out edits on a mongoDB database as a series of steps. If an error occurs on any of the steps, the database is returned to it's initial state (it's state before the transaction started). This README is not yet complete.
4
+
Fawn provides the ability to carry out edits on a mongoDB database as a series of steps. If an error occurs on any of the steps, the database is returned to it's initial state (it's state before the transaction started). This README is not yet complete.
5
5
6
6
## Getting Started:
7
7
@@ -10,19 +10,18 @@ Install [node.js](https://nodejs.org) and [mongoDB](https://www.mongodb.com/down
10
10
Start mongoDB in a terminal: ```mongod```
11
11
12
12
Then:
13
-
```npm install oj-lint```
13
+
```npm install fawn```
14
14
15
15
## Usage:
16
16
```javascript
17
-
varLint=require("oj-lint"); //not yet final. package name may change
17
+
varFawn=require("fawn"); //not yet final. package name may change
18
18
```
19
19
20
20
### Examples
21
21
Say you have two bank accounts, one belongs to John Smith and the other belongs to Broke Ass. You would like to transfer $20 from John Smith to Broke Ass. Assuming all first name and last name pairs are unique, this might look like:
22
22
23
23
```javascript
24
-
// assuming Lint has been initialized. See Lint.init below
> db (required): [mongoose](https://github.com/Automattic/mongoose) instance or [connection string](https://docs.mongodb.com/manual/reference/connection-string/)
58
57
59
-
> _collection (optional): name of collection to be used internally by Lint
58
+
> _collection (optional): name of collection to be used internally by Fawn
60
59
61
60
> options (optional. lol): Connection options. Same as [mongoose connection options](http://mongoosejs.com/docs/connections.html#options)
62
61
63
-
<br>If you're using mongoose in your project initialize Lint with mongoose:
62
+
<br>If you're using mongoose in your project initialize Fawn with mongoose:
### task.initModel(modelName, schema): To initialize a model with a Schema.
98
97
> modelName (required): Name of the collection associated with this model
99
98
100
99
> schema (required): Same as object passed to [mongoose Schema](http://mongoosejs.com/docs/guide.html#definition). Also see [validation](http://mongoosejs.com/docs/validation.html)
101
100
102
-
<br>If you're using mongoose, define your models with mongoose wherever possible. If the model has been defined by mongoose before this function is called, mongoose will throw an OverwriteModelError and if it was defined by Lint, Lint will throw an Error. Models can be defined only once.
101
+
<br>If you're using mongoose, define your models with mongoose wherever possible. If the model has been defined by mongoose before this function is called, mongoose will throw an OverwriteModelError and if it was defined by Fawn, Fawn will throw an Error. Models can be defined only once.
0 commit comments