adamspe / odata-resource

Node.JS+Express+REST
https://www.npmjs.com/package/odata-resource
12 stars 4 forks source link

odata features #8

Open alperenboyaci opened 5 years ago

alperenboyaci commented 5 years ago

Hi odata-resource is the best api for mongoose users so we need your updates. Is there any plan or timeline for improving your api with oData standards and more ?

$query $select spatialFilters : nearby, nearRoute, bbox(inboundingbox), etc lambda operator : any/all case insensitive feature grouping feature: () between feature : from-to date null or not null feature

Thanks Alperen

adamspe commented 5 years ago

Alperen,

I don't really have a plan to ever attempt to completely align with odata for this project. As mentioned in the Readme and an earlier correspondence with you this project may not have been aptly named since it is simply odata'ish in nature. I wanted to re-use some of what odata defines, particularly the $filter syntax.

I would love to make improvements here but at the moment I have a lot of customer projects that require my attention while this is an open source project that happens largely on the side. I will try to prioritize work here into my schedule however.

I'm not entirely clear on your list of requested features above so I'll comment on them one at a time here, please respond with details.

$query - I'm not familiar with this. It doesn't appear to be a standard odata query argument. Can you expand on this?

$select - I assume you're refering to the lack of support for $select in conjunction with $expand this issue?

spatialFilters : nearby, nearRoute, bbox(inboundingbox), etc - I guess I would have to review what odata actually supports in this area and see how that intersects with what MongoDB/Mongoose support. I have thought for some time about exporting some of the underlying filter processing classes and so may do that. If I were to do that then you could, in your own project, arbitrarily add functionality to $filter parsing to add support for whatever you wanted. I could then review those changes and perhaps incorporate some of the functionality if it fits.

lambda operator : any/all - I don't believe these were part of odata when I started this so I'll need to review that functionality to see how it fits but it strikes me that, at least for any, mongo queries already kind of work this way and searching of properties within arrays of objects just works with the current $filter syntax.

case insensitive feature - Haven't thought about this one in a while. I've in some cases augmented resources with the usage of a text index which then can allow for searching specific fields (as a group) case insensitive. Again extension of the $filter classes could give some leeway here (like ignorecase regexes for startswith, contains andendswith`).

grouping feature: () - If you're refering to grouping within $filter this is already there as of version 1.0. $filter parsing should now support arbitrarily complex filters with logical expressions grouped with parenthesis. here's a simple test case.

between feature : from-to date - This is also part of 1.0, mentioned in the readme. here's an example test case.

null or not null feature - This works already (though may differ from odata, not sure). You can simply do property eq null or property ne null in a filter to test for null. not null test case and null test case

Regards, Paul