Flexmonster Software License Agreement (“Agreement”) has been significantly revised and is effective as of September 30, 2024.
The following modifications were made:
The modified version of Flexmonster Software License Agreement is available here.
Downloading, installing, and/or continuing to use Flexmonster Software after September 30, 2024, constitutes Licensee’s acceptance of the terms and conditions of the modified version of Flexmonster Software License Agreement. If Licensee does not agree to any of these terms and conditions, they must cease using Flexmonster Software and must not download, install, use, access, or continue to access Flexmonster Software. By continuing to use Flexmonster Software or renewing the license under License Model or Maintenance after the effective date of any modifications to Agreement, Licensee accepts and agrees to be bound by the terms and conditions of the modified Agreement.
getMembers(mongoDBInstance: Db instance, index: String, fieldInfo: Object, page: Object)
[starting from version: 2.8]
This API call allows getting all members of the field from a MongoDB database. Used in the handler of the Flexmonster /members request. The getMembers
method is a part of the Flexmonster MongoDB Connector API.
Parameter/Type | Description |
---|---|
mongoDBInstance Db instance | The instance of the needed MongoDB database. |
index String | The collection’s name. The index is sent in the body of the Flexmonster request. |
fieldInfo Object | Contains information about the field. |
fieldInfo.field FieldObject | The field whose members should be sent in the response. The field is sent in the body of the Flexmonster request. |
fieldInfo.filter FilterGroupObject | Filters that should be applied to members. The filter is sent in the body of the Flexmonster request when multilevel hierarchies are configured in the component. |
page Object | Can be used to load members by parts. |
page.pageNumber Number | Page number. Starts from 0 . The pageNumber is sent in the body of the Flexmonster request. |
page.pageToken String | A key calculated on the server that defines which part of the data should be loaded next. The pageToken is sent in the body of the Flexmonster request. |
An array of objects, which contains all the members. The response format is the same as in the /members request.
1) Handling the /members request using the getMembers
method:
mongo.post("/members", async (req, res) => { try { const result = await MongoDataAPI.getMembers( mongoDBInstance, req.body.index, { req.body.field }, {pageNumber: req.body.page, pageToken: req.body.pageToken} ); res.json(result); } catch (err) { } });
2) Handling the /members request when multilevel hierarchies are configured in the component:
mongo.post("/members", async (req, res) => { try { const result = await MongoDataAPI.getMembers( mongoDBInstance, req.body.index, {field: req.body.field, filter: req.body.filter}, {pageNumber: req.body.page, pageToken: req.body.pageToken} ); res.json(result); } catch (err) { } });