@bluelibs/nova

中文文档
1.9.0发布于 2026/02/04MITTypeScriptCommonJS近 30 天下载 1827

Nova is a relational query layer over MongoDB Node Drivers

原始使用文档
文档目录5 节
  1. What does it solve?
  2. Documentation
  3. Sample
  4. GraphQL
  5. Support

BlueLibs NOVA



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

Documentation

Click here to go to the documentation

Sample

import { query, manyToOne } from "@bluelibs/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
    }
  })
}

GraphQL

import { query } from "@bluelibs/nova";

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

Support

This package is part of BlueLibs family. If you enjoy this work please show your support by starring the main package. If not, let us know what can we do to deserve it, our feedback form is here

版本与发布记录

@bluelibs/nova 共发布 28 个版本,首次发布于 2021/08/04;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.9.0latest2026/02/049 个月前
1.8.22025/07/041.3 年前
1.8.12024/10/142 年前
1.8.02024/10/142 年前
1.7.42024/10/132 年前
1.7.32024/10/022 年前

关于 @bluelibs/nova 的常见问题

@bluelibs/nova 是什么?

Nova is a relational query layer over MongoDB Node Drivers

如何安装 @bluelibs/nova?

在项目目录运行 npm install @bluelibs/nova,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:mongodb(^4.0.0 || ^5.0.0 || ^6.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@bluelibs/nova 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bluelibs/nova 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bluelibs/nova 可以商用吗?

@bluelibs/nova 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bluelibs/nova 的下载量有多少?

根据 npm 官方下载统计,@bluelibs/nova 在 2026/10/09 – 2026/11/07 这 30 天内被下载 1,827 次,日均约 61 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bluelibs/nova 还在维护吗?

最新版本 1.9.0 发布于 2026/02/04(9 个月前);至今共发布 28 个版本,其中过去 12 个月发布了 1 个;首次发布于 2021/08/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。