Skip to content
forked from FrancoisYu/nova

Nova is a relational query layer over MongoDB node drivers

License

Notifications You must be signed in to change notification settings

IulianCrudu/nova

 
 

Repository files navigation

Logo



Nova is the fetching layer on top of MongoDB Node Driver, which allows SQL-comparable speeds for retrieving relational data.

GraphQL is treated as a first-class citizen, by offering ability to transform the GraphQL query into a Nova query. You do not have to use GraphQL to use this library.

The incredible speed boost is possible thanks to the technology called Hypernova, you can read more about it inside the documentation.

What does it solve?

  • It makes it a joy to use MongoDB as a relational database
  • Support for relational filtering & sorting
  • Speeds surpassing SQL in various scenarios
  • Lower bandwidth used than SQL for joined documents
  • Works with the default MongoDB Node Drivers
  • Super light-weight integration for GraphQL

Installation

npm i -S @kaviar/nova

Sample

import { query, manyToOne } from "@kaviar/nova";

async function test() {
  const Post = await db.createCollection("Post");
  const Comments = await db.createCollection("Comments");

  manyToOne(Comments, Post, {
    // will automatically read from postId inside Comments
    linkName: "post",
    inversedLinkName: "comments",
  }); // also available manyToMany and manyToOne

  query(Post, {
    $: {
      filters: {
        isApproved: true
      }
    }
    title: 1,
    comments: {
      name: 1
    }
  })
}
import { query } from "@kaviar/nova";

const Query = {
  // Automatically fetches everything in the minimum amount of queries
  users(_, args, ctx, info) {
    return query.graphql(Posts, info).fetch();
  }
};

About

Nova is a relational query layer over MongoDB node drivers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%