Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ilgooz/service-objects
Manipulate Object Data
https://github.com/ilgooz/service-objects
Last synced: 2 months ago
JSON representation
Manipulate Object Data
- Host: GitHub
- URL: https://github.com/ilgooz/service-objects
- Owner: ilgooz
- Created: 2019-02-25T07:27:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-08T10:54:08.000Z (about 4 years ago)
- Last Synced: 2024-04-17T20:13:45.331Z (2 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Lists
- awesome - Objects - Manipulate and create data objects (Data Manipulation)
README
# Objects
Manipulate object data
# Contents
- [Installation](#Installation)
- [Definitions](#Definitions)
- [Tasks](#Tasks)
- [merge](#merge)
- [select](#select)
- [value](#value)# Installation
## MESG Core
This service requires [MESG Core](https://github.com/mesg-foundation/core) to be installed first.
You can install MESG Core by running the following command or [follow the installation guide](https://docs.mesg.com/guide/start-here/installation.html).
```bash
bash <(curl -fsSL https://mesg.com/install)
```## Service
Download the source code of this service, and then in the service's folder, run the following command:
```bash
mesg-core service deploy
```# Definitions
# Tasks
## merge
Task key: `merge`
merge multiple objects into one
### Inputs
| **Name** | **Key** | **Type** | **Description** |
| --- | --- | --- | --- |
| **sources** | `sources` | `Object` | Array of objects |### Outputs
#### failure
Output key: `failure`
| **Name** | **Key** | **Type** | **Description** |
| --- | --- | --- | --- |
| **message** | `message` | `String` | |#### success
Output key: `success`
| **Name** | **Key** | **Type** | **Description** |
| --- | --- | --- | --- |
| **data** | `data` | `Object` | Merged object data |## select
Task key: `select`
partially select some fields from object or array of objects
### Inputs
| **Name** | **Key** | **Type** | **Description** |
| --- | --- | --- | --- |
| **fields** | `fields` | `String` | field key patterns to match with field keys of objects |
| **flatten** | `flatten` | `Boolean` | **`optional`** flatten fields from child object to root object |
| **source** | `source` | `Any` | source data can be object or array of objects |### Outputs
#### failure
Output key: `failure`
| **Name** | **Key** | **Type** | **Description** |
| --- | --- | --- | --- |
| **message** | `message` | `String` | |#### success
Output key: `success`
| **Name** | **Key** | **Type** | **Description** |
| --- | --- | --- | --- |
| **data** | `data` | `Any` | New object or array of objects from selected fields |## value
Task key: `value`
Get named values from requested fields of matching objects
### Inputs
| **Name** | **Key** | **Type** | **Description** |
| --- | --- | --- | --- |
| **from** | `from` | `String` | Field to get its value from the matching object |
| **match** | `match` | `Object` | Filter to match with object fields |
| **sources** | `sources` | `Object` | Array of objects |### Outputs
#### failure
Output key: `failure`
| **Name** | **Key** | **Type** | **Description** |
| --- | --- | --- | --- |
| **message** | `message` | `String` | |#### success
Output key: `success`
| **Name** | **Key** | **Type** | **Description** |
| --- | --- | --- | --- |
| **data** | `data` | `Any` | Named values that built from requested fields of matching objects |