Using MongoDB with CommandBox

So far I’ve had the opportunity to work with two actively maintained CF wrappers for MongoDB Java driver:

  • Excellent Coldbox module (cbmongodb) by Jon Clausen - supported MongoDB version 3.2
  • Lucee MongoDB extension (GitHub - lucee/extension-mongodb) - supported MongoDB version 3.4 (current)

I already know the first one is incompatible with CommandBox CLI.
I am not sure whether Lucee Extensions can be used in CommandBox CLI (in task runners, not in server instances!).

Is there any existing MongoDB CF wrapper that can be used with CommandBox, specifically in tasks?

Thanks in advance for your suggestions.

> I am not sure whether Lucee Extensions can be used in CommandBox CLI (in task runners, not in server instances!).

It would be possible to install a Lucee 4 compatible extension into the Lucee server that powers the CLI, but I’m not sure exactly how you would do it. The “deploy” folder and automatic installation of Lucee extensions didn’t come along until Lucee 5 so you’d have to do some manual sort of install. Unfortunately, lucee 4 isn’t as flexible as the module service when it comes to one-the-fly installations :slight_smile: The entire concept of extensions however also are geared towards the idea of a server and not for ad-hoc CLI processes. This is a common issues in this area-- the ColdFusion community has always thought in terms of standard servers, installed and running for years, processing on a request basis. The CLI mindset doesn’t always go well with how most libraries were designed to be used.

I’m sure there are some plane jain MongoDB libs out there you could use inside of a task, but I’m not a Mongo guy so I really don’t know what’s out there. Your time would be better spent IMO modifying a module to load within CommandBox :slight_smile:

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com