1.0.21 • Published 4 years ago

node-grau v1.0.21

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago
>mongodb<.Collection()

    - Methods added 

        - getDoc()

            Get a document that matches the query given. If none matches, a document that matches the query given will be created. Returns Promise<Object>.

            ----------------------------------------------------------------------------------------------------------
            | Parameter        | Optional | Default | Type                       | Description                       |
            | ---------------- | -------- | ------- | -------------------------- | --------------------------------- |
            | query            | false    | null    | Anything                   | The object you want to match with |
            |                  |          |         |                            | the documents.                    |
            ----------------------------------------------------------------------------------------------------------

        - updateDoc()

            Update a document that matches the query given. If none matches, a document that matches the query given will be created and that document will be the one edited. Returns Promise<Object>.

            ---------------------------------------------------------------------------------------------------------
            | Parameter       | Optional | Default | Type                       | Description                       |
            | --------------- | -------- | ------- | -------------------------- | --------------------------------- |
            | query           | false    | null    | Anything                   | The object you want to match with |
            |                 |          |         |                            | the documents.                    |
            | --------------- | -------- | ------- | -------------------------- | ----------------------------------|
            | operation       | false    | null    | Object                     | Regular MongoDB operators object  |
            |                 |          |         |                            | you use.                          |
            ---------------------------------------------------------------------------------------------------------

        - giveItem()

            Add an item to a property of a document that matches the query given. If none matches, a document that matches the query given will be created and that document will be the one edited. If the property already have the item, it wont receive the item or will receive an increment in their currency property. Returns Promise<Object>.

            ---------------------------------------------------------------------------------------------------------
            | Parameter       | Optional | Default | Type                       | Description                       |
            | --------------- | -------- | ------- | -------------------------- | --------------------------------- |
            | query           | false    | null    | Anything                   | The object you want to match with |
            |                 |          |         |                            | the documents.                    |
            | --------------- | -------- | ------- | -------------------------- | --------------------------------- |
            | property        | false    | null    | Anything                   | The name of the property you want |
            |                 |          |         |                            | the item to be given to.          |
            | --------------- | -------- | ------- | -------------------------- | --------------------------------- |
            | item            | false    | null    | Anything                   | The item you want to add to the   |
            |                 |          |         |                            | property.                         |
            | --------------- | -------- | ------- | -------------------------- | --------------------------------- |
            | economySettings | true     | {}      | Object                     | The settings for the economy      |
            |                 |          |         |                            | increment thing.                  |
            | --------------- | -------- | ------- | -------------------------- | --------------------------------- |
            | economySettings | false    | null    | Object                     | The property you want to          |
            | .property       |          |         |                            | increment. Rules in MongoDB       |
            |                 |          |         |                            | Operators applies.                |
            | --------------- | -------- | ------- | -------------------------- | --------------------------------- |
            | economySettings | false    | null    | Number                     | How much the value you want to be |
            | .money          |          |         |                            | incremented with.                 |
            ---------------------------------------------------------------------------------------------------------
        
1.0.21

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.20

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.10

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago