Loopback support?

I see a few forum entries mentioning the loopback framework, but nothing current.
Can anyone tell me if couchbase server enterprise (any version) supports the loopback 4 framework? (n1ql I assume)

What does it mean to “support loopback 4 framework”?

“LoopBack is an award-winning, highly extensible, open-source Node.js and TypeScript framework based on Express. It enables you to quickly create APIs and microservices composed from backend systems such as databases and SOAP or REST services.”

Does couchbase have REST services? Yes it does.

However, you’ll find that the various Couchbase SDKs already have the logic to efficiently access a couchbase cluster. Start Using the Node.js SDK | Couchbase Docs

Thanks. To clarify, does Couchbase have a loopback library (e.g. installable via npm , that fits into the loopback framework (supporting n1ql)?
For example, here’s a pointer to the couchdb connector: https://loopback.io/doc/en/lb4/Database-connectors.html

If they don’t, sure you could build one, I see a few people that have tried to do 9 years ago in github, but I also see other hints that there might be an official library out there, so I’m wondering.

There’s none as far as I know.
The Couchbase SDKs need to compute the nodes where documents reside based on the documentId and the configuration map - so it’s a little more than making REST calls from javascript. Also - some of the apis are not rest apis.

I would think that the n1ql could work though, it’s just a rest call today and that’s the thing I would think that should be part of the library.

Appreciate your thoughts, we’ll see if anyone else chimes in, meanwhile I’ll look at those old github repo’s I found.


I would think that the n1ql could work though, it’s just a rest call

It could work, but not very well. If the query node specified in the url was unavailable, the call would just fail. If the query node specified in the url died during the call, the call would just fail. And there’s no load balancing. Probably plenty of other reasons.

The Couchbase SDK tracks which query nodes are available, and sends the query request to one of them. It will retry on failure, it will get results from replicas if you ask it to.

I’ll look at those old github repo’s

Lots of changes since 2020, so anything before that will probably work even less well.

Appreciate your expertise. Any ideas as to how to do this then?

We have Ottoman - Ottoman: Object Data Modeler (ODM) for Couchbase Node.js SDK

You can make a request for a loopback connector through customer support if you are an Enterprise customer, and via issues.couchbase.com if you are a Community customer.

1 Like

Thinking the node js sdk, bummer that couchbase doesn’t have this for loopback (very popular)