Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
updated README and travis testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Staender committed May 25, 2015
1 parent 696ec73 commit bf21966
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 46 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ services:
- neo4j
rvm:
- 1.9.3
before_install: ruby test/neo4j_services.rb install && sleep 2 && ruby test/neo4j_services.rb start && sleep 3
before_install:
- ruby test/neo4j_services.rb install && sleep 2 && ruby test/neo4j_services.rb start && sleep 3
55 changes: 15 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Mongraph [mɔ̃ ˈɡrɑːf]

Mongraph combines documentstorage database with graph-database relationships by creating a corresponding node for each document.

**Experimental. API may change.**
**Currently it's only tested against Neo4j v2.0 and Neo4j v2.1**
**Experimental**
**It's working with Neo4j v2.0.x - v2.1.x and MongoDB v2.x - v3.0**

### Installation

Expand All @@ -21,7 +21,7 @@ or clone the repository to your project and install dependencies with npm:
$ cd mongraph && npm install
```

### What's it good for?
### What is it good for?

MongoDB is great for a lot of things but a bit weak at relationships. However Neo4j is very powerful at this point but not the best solution for document storage. So why not using the best of both worlds?

Expand Down Expand Up @@ -201,47 +201,14 @@ By default all corresponding nodes are created indexed with the collection-name

#### Databases:

* MongoDB (~2)
* Neo4j (~2)
* MongoDB (>2)
* Neo4j (>2 and <2.2)

#### NPM modules:

* mongoose ORM <https://github.com/learnboost/mongoose> `npm install mongoose`
* Neo4j REST API client by thingdom <https://github.com/thingdom/node-neo4j> `npm install neo4j`

### Examples and Tests

You'll find examples in `test/tests.coffee` and `examples/`.

### Benchmarks

`npm run benchmark` should output s.th. like:

```
### CREATING RECORDS
* creating native mongodb documents x 964 ops/sec ±3.23% (68 runs sampled)
* creating mongoose documents x 521 ops/sec ±1.25% (81 runs sampled)
* creating neo4j nodes x 302 ops/sec ±13.87% (68 runs sampled)
* creating mongraph documents x 132 ops/sec ±9.01% (68 runs sampled)
**Fastest** is creating native mongodb documents
**Slowest** is creating mongraph documents
### FINDING RECORDS
* selecting node x 279 ops/sec ±1.40% (84 runs sampled)
* selecting native document x 627 ops/sec ±0.98% (80 runs sampled)
* selecting mongoosse document x 574 ops/sec ±1.30% (78 runs sampled)
* selecting document with corresponding node x 295 ops/sec ±9.45% (63 runs sampled)
**Fastest** is selecting native document
**Slowest** is selecting document with corresponding node
```

### Changelogs

#### 0.1.14
Expand All @@ -254,12 +221,20 @@ You'll find examples in `test/tests.coffee` and `examples/`.
* ignoring neo4j v<2
* tested sucessfully against mongodb 2.6.x and Neo4J v2.0.x and v2.1.x

### Tests
### Testing

Tested successfully against mongodb 2.6.x and Neo4J v2.0.x and v2.1.x.
Not ready for Neo4j v2.2 since the [neo4j module](https://github.com/thingdom/node-neo4j) for the latest Neo4j version is still under development.

Older Neo4j version than 2.x are not supported anymore.

To run tests, specify a port for neo4j (default is set to `7474`) and execute with:

```sh
$ mocha --globals=7010
```

This will run the tests against neo4j db on port 7010 - `globals` is a mocha specific argument which is used abusively as a workaround here ;)

### License

See [License file](https://github.com/pstaender/mongraph/blob/master/LICENSE).
Expand Down
2 changes: 1 addition & 1 deletion test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--require should
--reporter spec
--ui bdd
--timeout 10000
--timeout 20000
--compilers coffee:coffee-script/register
2 changes: 1 addition & 1 deletion test/neo4j_services.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby

path = "#{Dir.home}/neo4jtest/"
path = "#{Dir.home}/neo4j_instances/"

`mkdir -p #{path}`

Expand Down
6 changes: 3 additions & 3 deletions test/tests.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
args = require('minimist')(process.argv.slice(2))
args = require('minimist')(process.argv.slice(2))

neo4jPort = (Number) args.globals || 7474
neo4jPort = args.globals || 7474
neo4jPort = (Number) neo4jPort

neo4jURL = "http://localhost:#{neo4jPort}"
mongodbURL = 'mongodb://localhost/mongraph_test'
Expand All @@ -17,7 +18,6 @@ request = require('request')

describe "Mongraph", ->


_countNodes = (cb) -> graph.query "START n=node(*) RETURN count(n)", (err, count) ->
cb(err, Number(count?[0]?['count(n)']) || null)

Expand Down

0 comments on commit bf21966

Please sign in to comment.