MongoDB

110 views
Skip to first unread message

Kyle Spraggs

unread,
Mar 27, 2013, 1:50:05 PM3/27/13
to scrip...@googlegroups.com
I noticed you are working on a MongoDB driver (https://github.com/scriptella/scriptella-mongodb). Any status on the progress or ETA?

Fyodor Kupolov

unread,
Mar 27, 2013, 3:56:55 PM3/27/13
to scrip...@googlegroups.com
I hope to roll out a beta by mid April. Actually make some basic query/insert operations are available since yesterday. Example of the ETL which inserts a single record and then queries the collection and sends results to the text output:
    <script connection-id="mongo">
        {
        operation: 'db.collection.save',
        collection: 'test',
        data: {value: '?{etl.date.now()}'}
        }
    </script>

    <query connection-id="mongo">
        {
            operation: 'db.collection.find',
            collection: 'test' 
        }
        <script connection-id="log">
            Row id=$_id value = $value
        </script>
    </query>

DB operations are wrapped into JSON envelope, which provides metadata for the driver. With this approach it's not possible to write arbitrary scripts in JS, but only certain operations like commands/methods on a db or a collection. This is restrictive, but unlocks some performance optimizations and I believe it's closer to a notion of a query language. 

The properties substitution syntax is similar to JDBC driver, with one exception - binding needs to be inside a string literal, i.e. single or double quoted, e.g. '?variable' or "?{expression}". This trade-off was made to make content JSON compatible and simplify parsing and compilation of statements.

This is a prototype and any feedback/suggestions is highly appreciated!

Regards,
Fyodor

Kyle Spraggs

unread,
Mar 28, 2013, 9:54:07 PM3/28/13
to scrip...@googlegroups.com
Thanks for the update! I'll be checking it out in the coming week.

Kyle Spraggs

unread,
Apr 17, 2013, 2:23:32 PM4/17/13
to scrip...@googlegroups.com
Anymore updates on this? I see your still making commits. Is there somewhere I can check for an official status update or news?

Fyodor Kupolov

unread,
Apr 17, 2013, 4:54:23 PM4/17/13
to scrip...@googlegroups.com
I've just finished the example demonstrating 2-way migration between HSQLDB and MongoDB. It is available at https://github.com/scriptella/scriptella-examples/tree/master/mongodb
The snapshot version of the driver is available in the lib folder. I'll focus on the documentation and plan to create a release artifact somewhere in May, but the current snapshot is stable and tested, so you can use it for evaluation.

Kyle Spraggs

unread,
Apr 17, 2013, 10:10:05 PM4/17/13
to scrip...@googlegroups.com
Beautiful! Thanks!

Kyle Spraggs

unread,
Apr 18, 2013, 3:01:10 PM4/18/13
to scrip...@googlegroups.com
The only issue I've had so far is inserting integer values, e.g.,

id: '?id' always inserts a string?

Kyle Spraggs

unread,
Apr 18, 2013, 3:08:54 PM4/18/13
to scrip...@googlegroups.com
I managed to get this working by doing:

_id: "?{class:forName('java.lang.Integer').parseInt(id)}",

I suppose I could also wrap it in a <query> block and use script to convert to an int.

Kyle Spraggs

unread,
May 1, 2013, 1:06:47 PM5/1/13
to scrip...@googlegroups.com
Everything works fine until I add auth to the server. Is auth implemented? I can't seem to get any sort of authentication to work.

Fyodor Kupolov

unread,
May 1, 2013, 3:05:54 PM5/1/13
to scrip...@googlegroups.com

I have no access to my dev environment right now, i'll look into it next week. Meanwhile please check if you can use credentials in the uri - mongodb://[username:password@]host

Sent from a phone. Please forgive typos...

--
You received this message because you are subscribed to the Google Groups "Scriptella ETL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scriptella+...@googlegroups.com.
To post to this group, send email to scrip...@googlegroups.com.
Visit this group at http://groups.google.com/group/scriptella?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Fyodor Kupolov

unread,
May 6, 2013, 4:35:02 PM5/6/13
to scrip...@googlegroups.com
I've just committed the fix which allows specifying a user name and a password as attributes of the connection element. Previously it was only possible to specify them in the connection url. 

Reply all
Reply to author
Forward
0 new messages