BoxLang 🚀 A New JVM Dynamic Language Learn More...
The Ortus MongoDB Extension is a native Lucee Extension that allows your CFML server to connect to a Mongo server/cluster and leverage it for built-in caching, session storage, and NoSQL document storage.
MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era. MongoDB stores data in flexible, JSON-like documents, meaning fields can vary from document to document and data structure can be changed over time. MongoDB is free to use. Versions released prior to October 16, 2018 are published under the AGPL. All versions released after October 16, 2018, including patch fixes for prior versions, are published under the Server Side Public License (SSPL) v1. Learn More
Application.cfc
to connect to any network-accessable Mongo clustercachePut(), cacheGet(), cfcache action="get|put"
)cfcache action="content|cache|serverCache"
)MongoGetConnection( cacheName ), MongoGetProvider( cacheName )
Initialize the cluster:
A Docker compose file has been set up to allow for testing the extension within a cluster of MongoDB servers. To intialize the environment for the first time, run docker-compose up -d --build
Once the containers have been built and initialized, you will need to run the following command to initialize the MongoDB cluster:
docker exec -it ortus-mongodb-lucee-extension_mongodb_1 mongo --eval 'rs.initiate({ _id: "extension_test", members: [{ _id: 1, host: "mongodb:27017" }, { _id: 2, host: "mongo-repl1:27017" }, { _id: 3, host: "mongo-repl2:27017" }], settings: { getLastErrorDefaults: { w: "majority", wtimeout: 30000 }}})'
Note: if you have cloned the repo in to a custom named directory ( e.g. named mongodb
instead of ortus-mongodb-lucee-extension
), you will need to change that to your local directory name in the command above
Once the cluster is intialized you may build and deploy the extension and test by accessing http://127.0.0.1:61656/tests/runner.cfm
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.
mongodb+srv
connectionsv3.12.10
$
install 6A03159F-C6DC-4FCC-95A068B1E1A903FA
-Dlucee-extensions=6A03159F-C6DC-4FCC-95A068B1E1A903FA