Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rain1017 committed Aug 7, 2015
1 parent 117b73e commit 810578e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
28 changes: 2 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

- [x] __MongoDB Compatible__ : It's just a 'MongoDB' with transaction support, built-in 'Mongoose' support.

![Architecture](https://github.com/memdb/memdb/wiki/images/architecture.png)
![memdbshell.gif](https://github.com/memdb/memdb/wiki/images/memdbshell.gif)

## [The Wiki](https://github.com/memdb/memdb/wiki)

Expand Down Expand Up @@ -46,31 +46,7 @@ memdbcluster [start | stop | status] [--conf=memdb.conf.js] [--shard=shardId]
```

### Play with memdb shell

```js
$ memdb -s s1 [--conf=memdb.conf.js] // specify the shard's id to connect
MemDB shell
connected to 127.0.0.1:31017
memdb> db.insert('player', {_id : 1, name : 'rain'}) // insert a doc to 'player' collection
'1'
memdb> db.find('player', 1) // find doc by id
{ _id: '1', name: 'rain' }
memdb> db.commit() // commit changes
true
memdb> db.update('player', 1, {$set : {name : 'snow'}}) // update doc
1
memdb> db.find('player', 1, 'name')
{ name: 'snow' }
memdb> db.rollback() // rollback changes
true
memdb> db.find('player', 1, 'name')
{ name: 'rain' }
memdb> db.remove('player', 1) // remove doc
1
memdb> db.commit()
true
memdb> ^D (to exit)
```
See the top GIF, note how ACID transaction works.

### Nodejs Client with AutoConnection

Expand Down
4 changes: 2 additions & 2 deletions app/shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var DEFAULT_IDLE_TIMEOUT = 1800 * 1000;
var DEFAULT_PERSISTENT_DELAY = 600 * 1000;

// timeout for locking backend doc
var DEFAULT_BACKEND_LOCK_TIMEOUT = 10 * 1000;
var DEFAULT_BACKEND_LOCK_TIMEOUT = 30 * 1000;
// retry interval for backend lock
var DEFAULT_BACKEND_LOCK_RETRY_INTERVAL = 50;

Expand All @@ -66,7 +66,7 @@ var DEFAULT_BACKEND_LOCK_RETRY_INTERVAL = 50;
var DEFAULT_RELOAD_DELAY = 20;

// timeout for locking doc
var DEFAULT_LOCK_TIMEOUT = 10 * 1000;
var DEFAULT_LOCK_TIMEOUT = 30 * 1000;

// heartbeat settings, must be multiple of 1000
var DEFAULT_HEARTBEAT_INTERVAL = 2 * 1000;
Expand Down

0 comments on commit 810578e

Please sign in to comment.