https://github.com/novqigarrix/novo
Novo is a simple Object Data Modeling (ODM) for MongoDB with Deno Runtime
https://github.com/novqigarrix/novo
deno mongodb odm
Last synced: about 1 month ago
JSON representation
Novo is a simple Object Data Modeling (ODM) for MongoDB with Deno Runtime
- Host: GitHub
- URL: https://github.com/novqigarrix/novo
- Owner: NovqiGarrix
- Created: 2022-08-09T16:25:06.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-19T06:10:16.000Z (about 3 years ago)
- Last Synced: 2025-06-25T20:06:40.818Z (11 months ago)
- Topics: deno, mongodb, odm
- Language: TypeScript
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Novo
Novo is a simple Object Data Modeling (ODM) for MongoDB. Novo is created for
your Mongodb project in Deno. It's easy to use and blazingly fast.
## TODOs
Working further for Query Class.
## How to Use
You can run this example with:
```bash
deno task example
```
### Create a Model
```ts
// example/models/movie.model.ts
import {
novo,
ObjectId,
} from "https://raw.githubusercontent.com/NovqiGarrix/novo/main/mod.ts";
interface IMovieModel {
_id: ObjectId;
slug: string;
title: string;
poster: string;
createdAt: string;
updatedAt: string;
}
// "movies" is the collection name
const MovieModel = novo.model("movies");
export default MovieModel;
```
### Use The Model
```ts
import { novo } from "https://raw.githubusercontent.com/NovqiGarrix/novo/main/mod.ts";
import MovieModel from "./models/movie.model.ts";
await novo.connect("mongodb://localhost:27017/movies");
const avengerEndGame = await MovieModel.findOne({
slug: "avg-endgame",
});
console.log(`-- ${avengerEndGame?.title} --`);
console.log(avengerEndGame);
globalThis.addEventListener("unload", () => {
/** Disconnect from database when deno is about to exit.
* NOTE: This action is required.
*/
novo.disconnect();
});
Deno.exit(0);
```
## Run Unit Test
To run the unit tests:
```bash
deno task test
```
## Free for Contributions
Hey, Developers. I'm glad if we're working together on this project.