odatafy-mongodb
Version:
convert oData requests through odatafy to MongoDB queries
27 lines (26 loc) • 1.05 kB
TypeScript
import { FilterNode } from 'odatafy-parser';
import { Document } from 'mongodb';
type ProcessingOpts = {
withoutExpr?: boolean;
};
/**
* TODO: Support geo functions
* TODO: date and time and totalseconds currently not supported - fun1arg
* TODO: totaloffset minutes not supported - func1arg
*/
/**
* Get a MongoDB match stage based on oData filter expression
* @param filterExpr oData filter expression
* @param opts options for generating the match stage
* @returns MongoDB match stage
*/
export declare function generateMatchFromFilterExpr(filterExpr: string, opts?: ProcessingOpts): Document;
/**
* Get a MongoDB skip stage based on the ast of a parsed oData filter expression
* @param ast abstract syntax tree of the filter expression
* @param opts options for generating the match stage
* @returns MongoDB match stage
*/
export declare function generateMatchStage(ast: FilterNode, opts?: ProcessingOpts): Document;
export declare function processNode(node: FilterNode, parentExpr?: boolean, opts?: ProcessingOpts): any;
export {};