BoxLang 🚀 A New JVM Dynamic Language Learn More...

cbmongodb

v4.0.0+1 Modules


Copyright Since 2005 ColdBox Platform by Luis Majano and Ortus Solutions, Corp
www.coldbox.org | www.ortussolutions.com


Ortus ColdBox Module Template

This template can be used to create Ortus based ColdBox Modules. To use, just click the Use this Template button in the github repository: https://github.com/coldbox-modules/module-template and run the setup task from where you cloned it.

box task run taskFile=build/SetupTemplate

The SetupTemplate task will ask you for your module name, id and description and configure the template for you! Enjoy!

Directory Structure

The root of the module is the root of the repository. Add all the necessary files your module will need.

  • .github/workflows - These are the github actions to test and build the module via CI
  • build - This is the CommandBox task that builds the project. Only modify if needed. Most modules will never modify it. (Modify if needed)
  • test-harness - This is a ColdBox testing application, where you will add your testing files, specs etc.
  • .cfformat.json - A CFFormat using the Ortus Standards
  • .cflintrc - A CFLint configuration file according to Ortus Standards
  • .editorconfig - Smooth consistency between editors
  • .gitattributes - Git attributes
  • .gitignore - Basic ignores. Modify as needed.
  • .markdownlint.json - A linting file for markdown docs
  • box.json - The box.json for YOUR module. Modify as needed.
  • changelog.md - A nice changelog tracking file
  • ModuleConfig.cfc - Your module's configuration. Modify as needed.
  • readme.md - Your module's readme. Modify as needed.
  • [email protected] - A set of json files to configure the major engines your modules supports.

Test Harness

The test harness is created to bootstrap your working module into the application afterAspectsLoad. This is done in the config/ColdBox.cfc. It includes some key features:

  • config - Modify as needed
  • tests - All your testing specs should go here. Please notice the commented out ORM fixtures. Enable them if your module requires ORM
  • .cfconfig.json - A prepared cfconfig json file so your engine data is consistent. Modify as needed.
  • .env.sample - An environment property file sample. Copy and create a .env if your app requires it.

API Docs

The build task will take care of building API Docs using DocBox for you but ONLY for the models folder in your module. If you want to document more then make sure you modify the build/Build.cfc task.

Github Actions Automation

The github actions will clone, test, package, deploy your module to ForgeBox and the Ortus S3 accounts for API Docs and Artifacts. So please make sure the following environment variables are set in your repository. ** Please note that most of them are already defined at the org level **

  • FORGEBOX_TOKEN - The Ortus ForgeBox API Token
  • AWS_ACCESS_KEY - The travis user S3 account
  • AWS_ACCESS_SECRET - The travis secret S3

Please contact the admins in the #infrastructure channel for these credentials if needed

Welcome to ColdBox

ColdBox Hierarchical MVC is the de-facto enterprise-level HMVC framework for ColdFusion (CFML) developers. It's professionally backed, conventions-based, modular, highly extensible, and productive. Getting started with ColdBox is quick and painless. ColdBox takes the pain out of development by giving you a standardized methodology for modern ColdFusion (CFML) development with features such as:

Learning ColdBox

ColdBox is the defacto standard for building modern ColdFusion (CFML) applications. It has the most extensive documentation of all modern web application frameworks.

If you don't like reading so much, then you can try our video learning platform: CFCasts (www.cfcasts.com)

Ortus Sponsors

ColdBox is a professional open-source project and it is completely funded by the community and Ortus Solutions, Corp. Ortus Patreons get many benefits like a cfcasts account, a FORGEBOX Pro account and so much more. If you are interested in becoming a sponsor, please visit our patronage page: https://patreon.com/ortussolutions

THE DAILY BREAD

"I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.


Unreleased

4.0.0 - 2025-10-02

Changed

  • Updates MongoDb Driver to v4.9.1
  • MongoDB v7/8 compatibility
  • Drop support for Adobe < 2023
  • Drop support for Lucee < 5

[v3.11.1.0]

Changed

  • Updates MongoDB driver to v3.11.0

[v3.5.1.0]

Changed

  • Updates MongoDB driver to v3.5.0
  • Fixes an issue with incorrect sort results when using the ActiveEntity order() function

[v3.2.1.1]

Changed

  • ACF Compatibility Updates
  • Cleanup validation conditionals
  • Adds the ability to pass an additional match condition on a grouped aggregation - Allows for an additional match clause to limit the grouped results
  • Fixes casting errors on loaded entity save
  • Ensure entity _id is always cast as a string
  • Fixes merge issue with struct merge on population
  • Add check for _id in record struct

[v3.2.1.1]

Changed

  • Syntax corrections
  • Reverts auto-eviction to pre-v3.2.0.4 spec to prevent removal of normalized data prior to populate()
  • Ensures legacy index names, which weren't keyed off of the collection are dropped and re-created using new naming conventions

[v3.2.1.0]

Changed

  • Updates Mongo Driver to v3.2.1.0
  • ACF11 compatibility updates
  • Refactors module to use coldbox module skeleton
  • Adds automated Travis CI builds and deployments for source and new cbmongodb-be slug to Forgebox

[v3.2.0.4]

Changed

  • Fixes a schema issue where a parent struct is being overwritten by the default container when the child attribute is lower aphabetically
  • Fixes an issue with unique validation
  • Fixes population issues when passing nested structs
  • Fixes issues with nested keys on normalization
  • Adds auto-eviction prior to population
  • Adds explicit closing to cursor use for single record retrieval
  • Changes index naming scheme to prevent different collections from having the same index name hash
  • Adds the ability to pass a struct as the first argument to where()

[v3.2.0.3]

Changed

  • Fixes ACF Compatibility Issues

[v3.2.0.2]

Changed

  • Fixes issues with unexpected driver return types
  • Adds offset() helper method (alias for set_offset()) to ActiveEntity
  • Adds isObjectId() helper method to MongoUtil for detecting whether an object is a Mongo _id string

[v3.2.0.1]

Changed

  • Fixes issues with module load/unload connection operations
  • Adds GridFS operational support
  • Adds GridFS FileEntity model
  • Fixes issues with _id queries not being typed appropriately
  • Fixes error when attempting to truncate a collection

[v3.2.0.0]

Changed

  • Updates MongoDB Java driver to version 3.2.0
  • Adds support for readConcern configuration option

[v3.1.0.4:]

Changed

  • Adds validation methods for entities and support for new property ForceValidation, which will prevent saving of documents which do not validate
  • Adds auto-normalization capabilities for schema properties. When attributes are configured, schema will auto-normalize when set() and populate() methods are called.
  • Implements full support for component accessors on all schema properties. Var safe accessor closures are generated to allow recursion through an underscore delimiter (e.g. getFirstLevel_SecondLevel() to retrieve getDocument().FirstLevel.SecondLevel)
  • Fixes native CFML data types not being sanitized on deeply nested structs and arrays.
  • Add getDocument() and asStruct() utility methods, which can be used on unloaded and unloaded entities.
  • Adds append() and prepend() functions to assit in managing document schema arrays.
  • Fixes issues with property maps not being defined correctly and correct casting of boolean property defaults.
  • Adds MongoIndexer singleton to delegate index management away from Entity instances.

[v3.1.0.3:]

Changed

  • Fixes issue with connections not being pooled accurately and adds connection closing to module unload
  • Moves module bindings to onLoad() to ensure availability of cbjavaloader module
  • Changes return type of all single record retrievals inserts and updates to native structs and adds auto-stringification of _id (eliminates the need for toString())
  • Ensures version of returned object from findOneAndUpdate/findOneAndReplace operations is the after-save version

[v3.1.0:]

Changed

  • Removes Requirement For CFMongoDB Module
  • Adds Requirement for CBJavaloader Module
  • Implements MongoDB 3.0 Driver
  • Implements the ability to use multiple databases
  • Implements the ability to configure databases at the entity level
  • Implements Native Collection Methods for the 3.0 MongoCollection
  • Implements CFML Aggregation methods while allowing direct access to native driver methods
  • Implements CFML Map-Reduce methods
  • Demonstrates 52% reduction in query execution times and database operations from the previous version
  • Implements handlers for API documentation (/cmbongodb/docs) and Unit Tests (/cbmongodb/tests)
  • Fixes issue with near() GEOSpatial operations on Polygon objects
  • Re-factors Test Suite to Require the Framework Context
  • Adds an asJSON argument to find() and findAll() entity queries
  • Encapsulates all Collection Result queries to provide the following delivery methods: .asResult() - MongoIterable, .asCursor() - MongoIterator, .asArray(), asJSON()

$ box install cbmongodb

No collaborators yet.
     
5.00 / 1
  • {{ getFullDate("2015-01-20T08:57:06Z") }}
  • {{ getFullDate("2025-10-02T19:06:10Z") }}
  • 8,436
  • 8,262