No, that’s how the extension is set up. If you dump the connections, without a “top” argument, you’re going to see the full representation, including all of your collections, as a struct. If you dump the metadata of the connection, though, you’ll see it’s actually a native class “org.lucee.mongodb.DBImpl”. You’ll be able to see the methods that way without the dump normalizing the entire database.
Once you’ve created your connection, though, should always perform your operations on the collections (use these in your Models):
var myCollection = application.db1.getCollection("col1");
myCollection.insert({"test":"123"});
var cursor = myCollection.find();
while(cursor.hasNext()){
var document = cursor.next();
//do stuff here
}
--
See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your ticket NOW - http://www.cfcamp.org/
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/0ac2b671-9537-46bf-a9e1-6b0131fdc857%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var myCollection = application.db1.getCollection("col1");
is the same as
var myCollection = application.db1["col1"];
so you can do
application.db1["coll1"].insert(a_struct_I_made_earlier);
or
application.db1.getCollection("col1")
.insert(a_struct_I_made_earlier);
and it's all the same thing.
Or am I missing the point?
thanks
Richard
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/6e0bf2fc-7378-4bb1-8e2c-1327a1f5cb8a%40googlegroups.com.