# @node-jeneralize/mti

> Developing test data inserter for MongoDB

Latest version **0.1.3** (published 2023-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @node-jeneralize/mti
pnpm add @node-jeneralize/mti
yarn add @node-jeneralize/mti
bun add @node-jeneralize/mti
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2023-05-24 |
| First published | 2023-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | huequica |
| Maintainers | say-ya-sigma, huequica |

## Links

- npm: https://www.npmjs.com/package/@node-jeneralize/mti
- Repository: https://github.com/node-jeneralize/mti
- Issues: https://github.com/node-jeneralize/mti/issues
- npm.io page: https://npm.io/package/@node-jeneralize/mti

## Dependencies (1)

- [mongodb](https://npm.io/package/mongodb.md) ^5.5.0

## Recent versions

- 0.1.3 (latest) — 2023-05-24
- 0.1.2 — 2023-02-27
- 0.1.1 — 2023-02-27
- 0.1.0 — 2023-02-27

## README

<h1 align="center">
mti 🌱
</h1>

![NPM](https://img.shields.io/npm/l/@node-jeneralize/mti?style=flat-square)

> mti -> mongo testdata inserter

# Summary

This package can insert prepared documents into any MongoDB instance.  
`mti` is inspired by [gcp-kit/fti](https://github.com/gcp-kit/fti).

# Basically use

## 1. install

```shell
$ npm i -D @node-jeneralize/mti
```

## 2. create document data, post

```ts
import { mti, InjectableCollectionModule } from '@node-jeneralize/mti';

const users: User[] = [...new Array(10)].map((_, index) => {
  return {
    name: `sampleUser: ${hoge}`,
    version: 0,
    createdAt: new Date().toISOString(),
    updatedAt: new Date().toISOString(),
  };
});

const usersCollection: InjectableCollectionModule<User> = {
  collectionName: 'users',
  documents: users,
};

mti({
  uri: 'mongodb://root:password@127.0.0.1:8080',
  dbName: 'sample',
  insertCollections: [usersCollection],
  clientOptions: {
    authSource: 'admin',
  },
}).then(() => {
  console.log('Succeed to post testdata in mongoDB!');
});
```

---

For more use cases, see [docs](./docs).

# License

MIT

---
_Source: https://npm.io/package/@node-jeneralize/mti · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
