open-index/open-npm huggingface dataset:
npm package: @mother/mongoose-cursor-pagination
Description: Easy-to-use, scalable, cursor pagination plugin for mongoose
Author: Mother Co
Latest version: 0.0.6

# mongoose-cursor-pagination

[![Build Status](https://travis-ci.org/mother/mongoose-cursor-pagination.svg?branch=master)](https://travis-ci.org/mother/mongoose-cursor-pagination)

This small plugin makes it easy to use cursor-based pagination in your app, without changing the way you use queries in mongoose.

## Installation

```npm install @mother/mongoose-cursor-pagination --save```

Node.js 10.x or higher is required.

## Usage

In your schema:

```javascript
import mongoose from 'mongoose'
import paginationPlugin from '@mother/mongoose-cursor-pagination'

const CommentSchema = new mongoose.Schema({
  date: { type: Date },
  body: { type: String },
  author: {
     firstName: { type: String },
     lastName: { type: String }
  }
})

CommentSchema.plugin(paginationPlugin)
```

In your application code:

```javascript
const { results, pageInfo } = await Comment
   .find({})                 // Whatever filter you want
   .limit(30)                // Use limit and other Query options as you normally would
   .sort('author.lastName')  // Use sort as you would normally do
   .paginate(startCursor)    // startCursor optional
   .exec()                   // Required
```

`results` will be the results that you would expect from a normal mongoose `find` query

`pageInfo` will have two properties: `hasNext` and `nextCursor`

Be sure to index correctly. Note that this plugin always add `_id` to the sort key to ensure cursors are unique, so include that in your index as well. For example, say you are using the `date` field for pagination, then you would want to setup the index:

```js
commentSchema.index({ date: -1, _id: -1 })
```

## Plugin Options

You can optionally pass an options object to this plugin:

```js
CommentSchema.plugin(paginationPlugin, {
   // If no limit is specified, and paginate() is being used,
   // what should the default limit be.
   defaultLimit: 100
})
```

## Tests

Numerous tests are included in the `tests` directory, and can be run using the command `npm test`.

## To Do
- Test against older versions of mongoose
- Support for search with pagination
- Support for aggregation with pagination
- Support for `hasPrev` and `prevCursor`
- Support `exec` calls that use callbacks instead of promises

## License

MIT
npm package: @mother/socket.io-adapter-mongo
Description: socket.io adapter for MongoDB
Latest version: 0.0.7

# socket.io-adapter-mongo

[![Build Status](https://travis-ci.org/mother/socket.io-adapter-mongo.svg?branch=master)](https://travis-ci.org/mother/socket.io-adapter-mongo)

## Installing

```sh
npm install @mother/socket.io-adapter-mongo --save
```

## How to use

```js
const io = require('socket.io')(3000);
const mongoAdapter = require('@mother/socket.io-adapter-mongo');
io.adapter(mongoAdapter('mongodb://localhost/test'));
```

or pass an object:

```js
const io = require('socket.io')(3000);
const mongoAdapter = require('@mother/socket.io-adapter-mongo');

io.adapter(mongoAdapter({
	uri: 'mongodb://localhost/test',
	key: 'socket.io',
	mOptions: {
		tls: true
	}
}));
```

By running socket.io with the `socket.io-adapter-mongo` adapter you can run
multiple socket.io instances in different processes or servers that can
all broadcast and emit events to and from each other.

If you need to emit events to socket.io instances from a non-socket.io
process, you should use [socket.io-emitter](https://github.com/socketio/socket.io-emitter).

## API

### adapter(uri[, opts])

`uri` is a a mongodb:// uri string

If using this method of calling the adapter, the uri string will used instead of the uri property in the options object.

For a list of options see below.

### adapter(opts)

The following options are allowed:

- `uri`: mongodb:// uri string this property or the `mongoose` property are **required**.
- `key`: the name of the key to pub/sub events on as prefix (`socket.io`)
- `collectionName`: the name of the capped collection to be used (`socket.io-message-queue`)
- `collectionSize`: the size of the capped collection to be used, in bytes (`1000000`) (10mb)
- `mongoose`: an existing Mongoose instance that can be used instead of a mongodb:// uri
- `mOptions`: options to pass to Mongoose

## Notes

The following options are passed to Mongoose by default:

- `useNewUrlParser`: true
- `useUnifiedTopology`: true

If you want to override these options, just include them in `mOptions`.

## License

MIT
npm package: @motherduck/duckdb-wasm-shell
Description: <img src="https://raw.githubusercontent.com/duckdb/duckdb-wasm/main/misc/duckdb_wasm.svg" height="64">
Author: Andre Kohn
Latest version: 1.29.1-dev145.0

<img src="https://raw.githubusercontent.com/duckdb/duckdb-wasm/main/misc/duckdb_wasm.svg" height="64">

[![Main](https://github.com/duckdb/duckdb-wasm/actions/workflows/main.yml/badge.svg)](https://github.com/duckdb/duckdb-wasm/actions/workflows/main.yml)
[![Benchmarks](https://github.com/duckdb/duckdb-wasm/actions/workflows/benchmarks.yml/badge.svg)](https://github.com/duckdb/duckdb-wasm/actions/workflows/benchmarks.yml)
[![duckdb](https://cdn.jsdelivr.net/npm/@motherduck/duckdb-wasm@latest/dist/img/duckdb_version_badge.svg)](https://github.com/duckdb/duckdb)
[![npm](https://img.shields.io/npm/v/@motherduck/duckdb-wasm?logo=npm)](https://www.npmjs.com/package/@motherduck/duckdb-wasm-shell/v/latest)
[![JSDevlivr](https://data.jsdelivr.com/v1/package/npm/@motherduck/duckdb-wasm-shell/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@motherduck/duckdb-wasm-shell)

**DuckDB-Wasm Shell**

This library contains an embeddable standalone web shell for **@motherduck/duckdb-wasm**. Try it out at [shell.duckdb.org](https://shell.duckdb.org).