open-index/open-npm huggingface dataset:
npm package: @lyneup/mongoose-createorupdate
Description: A Promise-based Mongoose plugin for creating and updating documents in a single statement.
Latest version: 1.0.3

# mongoose-create-or-update

> A Promise-based Mongoose plugin for creating and updating documents in a single statement.

[![Build Status](https://travis-ci.org/neogeek/mongoose-create-or-update.svg?branch=master)](https://travis-ci.org/neogeek/mongoose-create-or-update)
[![codecov](https://img.shields.io/codecov/c/github/neogeek/mongoose-create-or-update/master.svg)](https://codecov.io/gh/neogeek/mongoose-create-or-update)
[![NPM Version](http://img.shields.io/npm/v/mongoose-create-or-update.svg?style=flat)](https://www.npmjs.org/package/mongoose-create-or-update)
[![Greenkeeper badge](https://badges.greenkeeper.io/neogeek/mongoose-create-or-update.svg)](https://greenkeeper.io/)
[![Latest Documentation](https://doxdox.org/images/badge-flat.svg)](https://doxdox.org/neogeek/mongoose-create-or-update)

## Install

```bash
$ npm install mongoose mongoose-create-or-update --save
```

## Usage

```javascript
const mongoose = require('mongoose');

const dataSchema = new mongoose.Schema({
    'contents': String
});

dataSchema.plugin(require('mongoose-create-or-update'));

const dataModel = mongoose.model('data', dataSchema);
```

```javascript
let dataId = null;

dataModel.createOrUpdate({
    '_id': dataId
}, {
    'contents': 'Lorem ipsum dolor sit amet'
}).then(data => {

    dataId = data._id;

    done();

}).catch(err => {

    console.log(err);

});
```

## Documentation

View full documentation [here](https://doxdox.org/neogeek/mongoose-create-or-update).
npm package: @lyngs/digger
Description: Use digger() to <get/set> value, from deep inside of an <object/array>.
Author: shook-lyngs
Latest version: 1.0.7

# @lyngs/digger

## What is this
`@lyngs/digger` provides a function for user to dig value out of a target.
Use `digger()` method to `get`or`set` value, from deep inside of an `object`or`array`.

## Install
```
npm install @lyngs/digger
```

## Usage
### Get
```javascript
// import @lyngs/digger
import digger from '@lyngs/digger';

const target = {
  people: [
    { name: 'shook' }
  ],
};

console.log(digger(target, 'people[0].name')); // 'shook'
```
### Set
```javascript
digger(target, 'people[0].name', 'oral'); // 'oral'
```
### Set with `extend` option
```javascript
// people[1] does'nt exists
digger(target, 'people[1].name', 'who'); // undefined

// layer extended when function context can't find certain property
digger(target, 'people[1].name', 'who', { extend: true }); // 'who'
```
### Set with `untie` option
```javascript
// people[0].name has been updated to anomymous function
digger(target, 'people[0].name', () => 'oral'); // [Function (anonymous)]

// param 'update' has been untied to get the result of function
digger(target, 'people[0].name', () => 'oral', { untie: true }); // 'oral'
```

### Build
```
npm run build
```

### Test
```
npm run test
```
npm package: @lyngs/merge
Description: Use merge() to merge every value. supporting types: <Object/Array/Set/Map>.
Author: shook-lyngs
Latest version: 1.0.9

# @lyngs/merge

## What is this
`@lyngs/merge` provides a function for user to merge value, just like `Object.assign()` did.
But the difference is `merge()` will literally merge every layers of params.
> support types: `Object`/`Array`/`Set`/`Map`.

## Install
```
npm install @lyngs/merge
```

## Usage
```javascript
// import @lyngs/merge
import merge from '@lyngs/merge';

const target = {
  info: {
    weather: 'sunny',
  },
  people: [
    { name: 'shook', age: 16 }
  ],
};

merge(target,
  {
    info: {
      dateTime: Date.now(),
      weather: 'cloudy',
    },
  },
  {
    people: [
      { name: 'oral' },
      { name: 'lyngs', age: 15 },
    ],
  }
);

console.log(target);
/**
 {
	info: {
		dateTime: 1605451585612,
		weather: 'cloudy',
	}，
	people: [
		{ name: 'oral', age: 16 },
		{ name: 'lyngs', age: 15 },
	],
}
 **/
```

### Build
```
npm run build
```

### Test
```
npm run test
```