Skip to content

Commit 224d188

Browse files
committed
readme heading so meteor publish will be happy
1 parent 7eab237 commit 224d188

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ Meteor.call 'newMsg', roomId, msgId, text, (err, result) ->
6060

6161
That's all there is to it! Now you can use any database reactively with Meteor!
6262

63-
## Bells and Whistles
63+
# Bells and Whistles
6464

65-
### Publishing Cursors
65+
## Publishing Cursors
6666

6767
This package can also publish any cursor that implements [`Cursor.observeChanges`][observeChanges]. Meteor's `mongo` pacakge works right out of the box:
6868

@@ -94,7 +94,7 @@ I could use some help building drivers for reactive databases like Redis and Ret
9494
All we need to do is implement `observeChanges` on a query cursor. There are also other
9595
other tools for making MySQL and Postgres reactive as well.
9696

97-
### Publishing REST APIs
97+
## Publishing REST APIs
9898

9999
This package is also suitable for publishing data continuously from REST APIs. Typically, you might use `Meteor.methods`, calling it periodically from the client using `Meteor.setInterval` to get updated results.
100100

@@ -132,26 +132,26 @@ Template.events.events
132132
events.trigger()
133133
```
134134

135-
## Examples
135+
# Examples
136136

137137
There are several [examples](/examples/) to check out, but most of them are really just end-to-end tests. The best example to check out is the [chatroom](/examples/chatroom/). This example uses Neo4j as a database to create a chatroom.
138138

139-
## How it works
139+
# How it works
140140

141141
The codebase is actually pretty straightforward and I made sure to include LOTS of comments.
142142
There are also plenty links to the Meteor codebase in the comments describing how I figured things out that are currently undocumented. Feel free to [dive in](/src/db.coffee)!
143143

144-
### Server
144+
## Server
145145

146146
Each publication accepts a query function which must return a collection of documents that must contain a unique `_id` field. [DDP does not yet support ordered queries][DDP_spec] so every DDP message related to `addedBefore` or `movedBefore` has an additional (salted) key-value specifying the subscription and position.
147147

148-
### Client
148+
## Client
149149

150150
On the client, we have an object, `DBSubscriptionCursor`, that encapsulates everything data-related in Meteor: `Meteor.subscribe`, `Mongo.Collection`, and `Mongo.Cursor`. We simple use `connection.registerStore` to register a data store and treat `DBSubscriptionCursor` as an observer, calling the appropriate [`Cursor.observeChanges`][observeChanges] method on each active subscription.
151151

152-
## Docs
152+
# Docs
153153

154-
### `DB.publish(options)`
154+
#### `DB.publish(options)`
155155

156156
`options` object fields:
157157
- `name`: name of the publication. (required)
@@ -192,7 +192,7 @@ Meteor.methods
192192
```
193193

194194

195-
### `sub = DB.createSubscription(name, args...)`
195+
#### `sub = DB.createSubscription(name, args...)`
196196

197197
This function returns a `DBSubscriptionCursor` object.
198198

@@ -260,10 +260,11 @@ Template.main.events
260260
elem.value = ''
261261
```
262262

263-
## TODO
263+
# TODO
264264

265265
- Subscriptions from server to server
266266
- Use Tracker for pub/sub dependencies
267+
- Automated tests!
267268
- Database drivers:
268269
- rethinkdb
269270
- redis

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
name: 'ccorcos:any-db',
3-
summary: 'Database API for Meteor',
3+
summary: 'A database API for Meteor',
44
version: '0.0.1',
55
git: 'https://github.com/ccorcos/meteor-any-db'
66
});

0 commit comments

Comments
 (0)