Search...
ge( )
Refines a query to match items whose specified property value is greater than or equal to the specified value.
Description
The ge()
function refines a SessionQueryBuilder
to only
match items where the value of the specified property is greater than or
equal to the specified value
.
Syntax
function ge(propertyName: string, value: Date): SessionQueryBuilder
ge Parameters
NAME
TYPE
DESCRIPTION
propertyName
string
The property whose value will be compared with value
.
Supported properties:
start.timestamp
value
Date
The value to match against.
Was this helpful?
Add a greater than or equals filter to a query
Copy Code
1let query = sessions.querySessions().ge("startTime", "2020-04-27T10:00:00.000Z");
Create a query, add a greater than or equals filter, and run it
Copy Code
1import { sessions } from "wix-bookings-backend";23// ...45sessions.querySessions()6 .ge("end.timestamp", "2021-01-01T00:00:00.000Z")7 .lt("start.timestamp", "2021-05-01T00:00:00.000Z")8 .find()9 .then((results) => {10 if (results.items.length > 0) {11 const items = results.items;12 const firstItem = items[0];13 const totalCount = results.totalCount;14 const pageSize = results.pageSize;15 const currentPage = results.currentPage;16 const totalPages = results.totalPages;17 const hasNext = results.hasNext();18 const hasPrev = results.hasPrev();19 const length = results.length;20 const query = results.query;21 } else {22 // handle case where no matching items found23 }24 })25 .catch((error) => {26 console.error(error);27 });