clay-collection

Entity collection for ClayDB

Entity collection for ClayDB

Installation

$ npm install clay-collection --save

Usage

'use strict'

const clayEntity = require('clay-entity')
const clayCollection = require('clay-collection')

{
  let collection = clayCollection({
    entities: [
      clayEntity({ id: 1, title: 'Foo' }),
      clayEntity({ id: 2, title: 'Bar' }),
    ],
    meta: {
      total: 100,
      offset: 0,
      limit: 2
    },
    filter: { foo: 'bar' }
  })
  /* ... */
}

API

clay-collection@3.1.4

Entity collection for ClayDB

Functions

create(args) -> Collection

Create a Collection instance

Param Type Description
args *

License

This software is released under the Apache-2.0 License.

Links

HomePage

https://github.com/realglobe-Inc/clay-collection#readme

Repository

realglobe-Inc/clay-collection


公众号

欢迎 JavaScript 爱好者