Skip to content

Commit

Permalink
chore(docs): update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Feb 25, 2024
1 parent 07eab60 commit 2a35937
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 8 deletions.
109 changes: 107 additions & 2 deletions README_AGGREGATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Returns **[Object][2]** an object containing a MongoDb projection object
* `$0.from`  
* `$0.as`  
* `$0.localField`  
* `$0.foreignField`  
* `$0.foreignField` (optional, default `'id'`)
* `$0.pipeline` (optional, default `[]`)

### Properties
Expand All @@ -161,11 +161,116 @@ Returns **[Object][2]** an object containing a MongoDb projection object
* `options.from`  
* `options.as`  
* `options.localField`  
* `options.foreignField`  
* `options.foreignField` (optional, default `'id'`)
* `options.pipeline` (optional, default `[]`)

Returns **[Object][2]** 

## REDUCE

### Parameters

* `$0` **[Object][2]** 

* `$0.input`  
* `$0.initialValue` (optional, default `{}`)
* `$0.inExpression`  

### Properties

* `input` **[String][1]** any expression resolving to an array
* `initialValue` **any** the initial value used for reduction
* `inExpression` **[Object][2]** any expression applied to each element of the array

## REDUCE

### Parameters

* `options` **ReduceOptions** 

* `options.input`  
* `options.initialValue` (optional, default `{}`)
* `options.inExpression`  

Returns **[Object][2]** 

## APPEND\_OBJECTS

Returns a $mergeObjects expression that appends the result of the given expressions to $$value

### Parameters

* `expressions` **...any** a list of expressions that evaluate to an object

Returns **[Object][2]** 

## LET

### Parameters

* `$0` **[Object][2]** 

* `$0.vars`  
* `$0.inExpression`  

### Properties

* `vars` **[Object][2]** an object defining additional variables for the expression
* `inExpression` **[Object][2]** any expression

## LET

### Parameters

* `options` **LetOptions** 

* `options.vars`  
* `options.inExpression`  

## TO\_OBJECT

### Parameters

* `$0` **[Object][2]** 

* `$0.key` (optional, default `"$$this"`)
* `$0.value`  

### Properties

* `key` **[String][1]** the object key
* `expression` **[Object][2]** any expression

## TO\_OBJECT

### Parameters

* `options` **ToObjectOptions** 

* `options.key` (optional, default `"$$this"`)
* `options.value`  

## CONCAT\_STRINGS

### Parameters

* `strings` **...any** strings to concat

Returns **[Object][2]** 

## JOIN\_STRINGS

### Parameters

* `separator` **[String][1]** separator to be used for joining given strings
* `strings` **...any** strings to concat

Returns **[Object][2]** 

## CONCAT\_ARRAYS

Returns **[Object][2]** 

## ELEMENT\_AT

### Parameters
Expand Down
14 changes: 8 additions & 6 deletions README_SIMPLE_RESOURCE_STORAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ Returns **[Array][4]<[Object][5]>**&#x20;

Returns all children of a certain type/collection. Imagine this method walking a tree and returning all leaves at a certain level.

Example:

### Parameters

* `resourceIds` **([String][1] | [Array][4]<[String][1]>)** resource ids that will added to the resource path i.e. /users/${id}/documents/${id}
* `childPath` **([String][1] | [Array][4]<[String][1]>)** the path of the children to query e.g. /api\_clients/queues/messages
* `options` **GetOptions**&#x20;

Returns **[Promise][6]\<ChildrenAndResourcePaths>**&#x20;

## find

* **See**: [README\_AGGREGATIONS.md][6]
* **See**: [README\_AGGREGATIONS.md][7]

Returns all resources that pass the given aggregation stages.

Expand All @@ -82,7 +82,7 @@ Returns true if a resource with given ids exists.

* `resourceIds` **([String][1] | [Array][4]<[String][1]>)**&#x20;

Returns **[boolean][7]**&#x20;
Returns **[boolean][8]**&#x20;

## create

Expand Down Expand Up @@ -126,6 +126,8 @@ Returns **void**&#x20;

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[6]: README_AGGREGATIONS.md
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise

[7]: README_AGGREGATIONS.md

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

0 comments on commit 2a35937

Please sign in to comment.