Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rethinkdb-traits

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rethinkdb-traits - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

package.json
{
"name": "rethinkdb-traits",
"version": "0.0.2",
"version": "0.0.3",
"description": "A RethinkDB query composer.",

@@ -5,0 +5,0 @@ "main": "index.js",

# rethinkdb-traits
A library to compose rethinkdb queries with NodeJS
This is not an ORM. It's a library to organise related queries around tables. It does not assume anything about relations, but rather let's you express relations yourself, through functions.
A library to compose rethinkdb queries with NodeJS.
This is not an ORM. It's a library to organize your queries. It does not assume anything about relations.
It *does* create table on definition, and indexes as well. It makes it easier to perform queries, in a modelish way, without having a reference to the connection.
## To install

@@ -26,13 +29,18 @@ ```shell

const groupTraits = {
byName: function (rql,name) {
return rql.filter({ name });
},
withPeople: function (rql) {
const $r = this.$r;
return rql.merge(function(group) {
return group.merge({
people: this.$r.table('people').getAll(group('id'), { index: 'groupId' });
people: $r.table('people').getAll(group('id'), { index: 'groupId' });
});
})
},
// you can chain and reuse 'before' and 'after' functions
after: {
withPeople: [
'byName,withPeople': [
function (rql) {

@@ -84,3 +92,3 @@

logJson(groups);
console.log(groups);
return Promise.all([Person.delete(),Group.delete()]);

@@ -87,0 +95,0 @@ }).then( () => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc