UNPKG

odatafy-mongodb

Version:

convert oData requests through odatafy to MongoDB queries

15 lines (14 loc) 560 B
import { Document } from 'mongodb'; import { OrderbyNode } from 'odatafy-parser'; /** * Get MongoDB sort stage based on an oData url orderby expression * @param expr expression from url * @returns MongoDB sort stage */ export declare function generateSortFromOrderbyExpr(expr: string): Document; /** * Get MongoDB sort stage based on the syntax tree of an oData orderby expression * @param ast abstract syntax tree of the parsed orderby expression * @returns MongoDB sort stage */ export declare function generateSortStage(ast: OrderbyNode): Document;