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

Ortus MongoDB Cache

v1.2.0+5291 Lucee Extensions

Ortus MongoDB Extension

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

Requirements

  • Lucee 5.1.0 and above
  • Mongo 4.0.X and above

Features In A Nutshell

  • Add Mongo native functionality to any Lucee server
  • Install at server level (Available to all contexts)
  • Create Cache connections in the Lucee web administrator or via Application.cfc to connect to any network-accessable Mongo cluster
  • Set and get objects from Mongo via standard CFML functions and tags (cachePut(), cacheGet(), cfcache action="get|put")
  • Fully supports all built-in Lucee cache functions including wildcard filters
  • Seamlessly distribute storage of the following to any Mongo Cluster ** Lucee session storage ** Lucee client storage ** Lucee Ram resouces (ram://...)
  • Seamlessly cache the following to any timeout-sensitive Mongo key ** Results of database queries ** Results of deterministic functions ** Complex or simple objects in your application's code ** Cached templates (cfcache action="content|cache|serverCache")
  • Extremely lightweight and fast
  • Native Mongo functions: MongoGetConnection( cacheName ), MongoGetProvider( cacheName )

Development Environment Setup

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

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.


[2.0.0] => 2022-01

Added

  • Added support for mongodb+srv connections

Updated

  • Updated MongoDB Java Driver to v3.12.10

Changed

  • Removed snapshot isolation arguments as they were deprecated in v3.4

[1.1.2] => 2021-05

Fixed

  • Resolves an issue where MongoDB would not exipire cache items because of improper date casting

[1.1.1] => 2020-11

Added

  • Adds cluster capabilities via a delimited list of hosts. A delimited list of ports or a single port may be provided

[1.1.0] => 2020-06

Added

  • Adds compatibility for versions of Lucee greater than 5.2.9

[1.0.0] => 2019-10

Added

  • First Version
  •   Ortus Solutions
  • Published
  • 1.2.0+5291 is the latest of 10 release(s)
    Published
  • Published on {{ getFullDate("2022-01-07T22:08:39Z") }}

  • Install String
    $ install 6A03159F-C6DC-4FCC-95A068B1E1A903FA
  • JVM Argument
    -Dlucee-extensions=6A03159F-C6DC-4FCC-95A068B1E1A903FA
  • No collaborators yet.
       
    • {{ getFullDate("2019-08-29T16:12:40Z") }}
    • {{ getFullDate("2022-01-07T22:08:39Z") }}
    • 3,924
    • 15,716