-
Notifications
You must be signed in to change notification settings - Fork 4
Reference
Fyodor Kupolov edited this page May 6, 2013
·
11 revisions
| Driver class: | org.scriptella.mongodb.Driver |
| URL: |
mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] |
| Runtime dependencies: | MongoDB Java Driver |
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="in">
{
operation: 'db.collection.find',
collection: 'users',
data: {}
}
<script connection-id="log">
Migrating User: user_id=$user_id
</script>
</query>
Run a specified command. See MongoDB documenation for description.
Example:
<!-- Drop test collection -->
<script connection-id="mongo">
{
operation: 'db.runCommand',
data: { drop: 'test' }
}
</script>
Selects documents from the collection and executes nested script/query elements for each document returned. The "data" parameter specifies the selection criteria. See MongoDB documenation for description.
Example
<!-- Migrate all users -->
<query connection-id="in">
{
operation: 'db.collection.find',
collection: 'users',
data: {}
}
<script .... >
- db.collection.save
- db.collection.update