Custom API - Unable to call GET on internal service

I am quite new to this platform and building things based on the documentation.

I want to create a Custom API which basically invokes a mongoDB service to pull the data from multiple tables and compose the output.

I have created the NodeJS service under Service tab and assigned the role mapped with the user.
I don’t see the internal service is getting invoked at all. Below is the code snippet.

var result = {dummy: “dummy”};
var callback = (body, response) => {
result = JSON.parse(body);
// get all records using internal URL
let url = mongodb/_table/tbl_account;
platform.api.get(url, null, callback);
return result;

Value your help.

Hello @rmadhavan.
As far as what I understand, you have created a MongoDB service and a scripted service. And in your nodejs scripted service, you are trying to call the tables in MongoDB database.

In order to pull data from multiple tables, you can use DreamFactory’s data mesh feature. It allows you to combine data from two tables in the same database or you can combine multiple tables residing on different databases like MS SQL or MYSQL as well. You can find out more here -

This is an easier way to combine two tables with point and click. You can have multiple tables joined together accessible through a single endpoint.

Scripting service
If you want to go to the scripting service route, this is a great place to start - This will allow you to add the NodeJs scripted logic to your MongoDB service.

Let us know if you have any more questions