Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vicary/node-red-contrib-objectid
set objectid to query node-red mongodb
https://github.com/vicary/node-red-contrib-objectid
Last synced: 27 days ago
JSON representation
set objectid to query node-red mongodb
- Host: GitHub
- URL: https://github.com/vicary/node-red-contrib-objectid
- Owner: vicary
- Created: 2017-05-09T08:21:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-30T16:49:06.000Z (over 3 years ago)
- Last Synced: 2024-04-14T13:52:01.591Z (9 months ago)
- Language: HTML
- Size: 19.5 KB
- Stars: 1
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-red-contrib-objectid
Node-Red Node to create an ObjectID for queries in mongodb## Forking Note
I will publish this fork under the name of `node-red-contrib-bson` until the contributors in `node-red-contrib-objectid`
treats message properly with `RED.util.getMessageProperty` and `RED.util.setMessageProperty`.## Usage
This small node-red node is used to create an ObjectID for mongodb.
The selected property in `msg` will be converted to an ObjectID, you can input a 24 char hexstring and create an ObjectID from it.
For example: `msg._id = "572dbc06f307c8682045c55c"`
If the target property is null, a random id is created.
### Deep reference
Deep reference is supported as a dot-separated string, e.g. `payload._id`.
### Array support
This module provides limited array support when the ending value is array.
For example, the following will work via this path `"payload._id.$in"`:
```javascript
{
payload: {
_id: {
$in: [
"5a8a92939034785a569ae7b8",
"5a8a92979034785a569ae7b9"
]
}
}
};
```## License
__MIT:__
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.