An open API service indexing awesome lists of open source software.

https://github.com/lagden/rethink-lab


https://github.com/lagden/rethink-lab

changefeed chat rethinkdb websocket

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# Chat - RethinkDB

[![XO code style][xo-img]][xo]

[xo-img]: https://img.shields.io/badge/code_style-XO-5ed9c7.svg
[xo]: https://github.com/sindresorhus/xo

Apenas um show!!

## Estrutura

Cada corretora tem seu banco de dados `broker_{id}` e uma tabela `messages`

# Listar uma conversa

Todas as mensagens são gravadas na tabela `messages`,
e o campo `room` é utilizado agrupá-las.

Abaixo temos o exemplo de uma query para listar as 10 últimas mensagens de uma `room`

```javascript
r
.db('broker_8')
.table('messages')
.filter({room: 'ana_lucas'})
.orderBy('date')
.limit(10)
```

## License

MIT © [Thiago Lagden](http://lagden.in)