Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
odata-v4-mongodb
Advanced tools
Service OData v4 requests from a MongoDB data store.
The OData V4 MongoDB Connector provides functionality to convert the various types of OData segments into MongoDB query objects, that you can execute over a MongoDB database.
import { createFilter } from 'odata-v4-mongodb'
//example request: GET /api/products?$filter=category/id eq 5 or color eq 'Red'
app.get("/api/products", (req: Request, res: Response) => {
const filter = createFilter(req.query.$filter);
// collection instance from MongoDB Node.JS Driver
collection.find(filter, function(err, data){
res.json({
'@odata.context': req.protocol + '://' + req.get('host') + '/api/$metadata#products',
value: data
});
});
});
var createFilter = require('odata-v4-mongodb').createFilter;
app.get("/api/products", function(req, res) {
var filter = createFilter(req.query.$filter);
// collection instance from MongoDB Node.JS Driver
collection.find(filter, function(err, data){
res.json({
'@odata.context': req.protocol + '://' + req.get('host') + '/api/$metadata#products',
value: data
});
});
})
For now $filter, $select, $skip and $top
Support for $expand is next.
The OData v4 Parser layer supports 100% of the specification. The Connector is supporting basic MongoDB queries.
We are into creating a comprehensive feature availability chart for V1 release
√ expression 5.1.1.6.1: NullValue eq null
√ expression 5.1.1.6.1: TrueValue eq true
√ expression 5.1.1.6.1: FalseValue eq false
√ expression 5.1.1.6.1: IntegerValue lt -128
√ expression 5.1.1.6.1: DecimalValue eq 34.95
√ expression 5.1.1.6.1: StringValue eq 'Say Hello,then go'
√ expression 5.1.1.6.1: DurationValue eq duration'P12DT23H59M59.999999999999S'
√ expression 5.1.1.6.1: DateValue eq 2012-12-03
√ expression 5.1.1.6.1: DateTimeOffsetValue eq 2012-12-03T07:16:23Z
√ expression 5.1.1.6.1: GuidValue eq 01234567-89ab-cdef-0123-456789abcdef
√ expression 5.1.1.6.1: Int64Value eq 0
√ expression 5.1.1.6.1: A eq INF
√ expression 5.1.1.6.1: A eq 0.31415926535897931e1
√ expression 5.1.1.1.2: A ne 1
√ expression 5.1.1.1.3: A gt 2
√ expression 5.1.1.1.4: A ge 3
√ expression 5.1.1.1.5: A lt 2
√ expression 5.1.1.1.6: A le 2
√ expression: A/b eq 1
√ expression 5.1.1.3: (A/b eq 2) or (B/c lt 4) and ((E gt 5) or (E lt -1))
FAQs
Service OData requests from a MongoDB data store
The npm package odata-v4-mongodb receives a total of 651 weekly downloads. As such, odata-v4-mongodb popularity was classified as not popular.
We found that odata-v4-mongodb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.