Skip to content
This repository was archived by the owner on Jan 29, 2022. It is now read-only.

Commit 928691c

Browse files
author
Peter Ableda
committed
Merge branches 'master' and 'master' of github.com:sspinc/mongo-hadoop
* 'master' of github.com:sspinc/mongo-hadoop: Fix usage of MongoInsertStorage and update description Fix usage of MongoInsertStorage * 'master' of github.com:sspinc/mongo-hadoop: Fix usage of MongoInsertStorage and update description Fix usage of MongoInsertStorage
2 parents a486e76 + ac08472 commit 928691c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

examples/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ Amazon Piggybank jar: http://aws.amazon.com/code/Elastic-MapReduce/2730
8484
by_year = GROUP parsed_year BY (chararray)year;
8585
year_10yearavg = FOREACH by_year GENERATE group, AVG(parsed_year.bc) as tenyear_avg;
8686

87-
-- Args to MongoInsertStorage are: schema for output doc, field to use as '_id'.
87+
-- Arg to MongoInsertStorage: field to use as '_id'.
8888
STORE year_10yearavg
8989
INTO 'mongodb://localhost:27017/demo.asfkjabfa'
9090
USING
91-
com.mongodb.hadoop.pig.MongoInsertStorage('group:chararray,tenyear_avg:float', 'group');
91+
com.mongodb.hadoop.pig.MongoInsertStorage('group');
9292

9393

9494

@@ -315,4 +315,4 @@ After phase two is finished, the result documents look like this (the `logs_coun
315315
],
316316
"logs_count": 1050616
317317
}
318-
```
318+
```

pig/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ file, you will also need to set `fs.s3.awsAccessKeyId` and `fs.s3.awsSecretAcces
9696

9797
To make each output record be used as an insert into a MongoDB collection, use the `MongoInsertStorage` class supplying the output URI.
9898
For example:
99+
```
100+
STORE <aliasname> INTO 'mongodb://localhost:27017/<db>.<collection>'
101+
USING com.mongodb.hadoop.pig.MongoInsertStorage('<idAlias>');
102+
```
99103

100-
STORE dates_averages INTO 'mongodb://localhost:27017/demo.yield_aggregated' USING com.mongodb.hadoop.pig.MongoInsertStorage('', '' );
101-
102-
The `MongoInsertStorage` class also takes two args: an `idAlias` and a `schema` as described above. If `schema` is left blank, it will
103-
attempt to infer the output schema from the data using the strategy described above. If `idAlias` is left blank, an `ObjectId` will be
104-
generated for the value of the `_id` field in each output document.
104+
The `MongoInsertStorage` class takes an argument: `idAlias` as described above. If `idAlias` is left blank, an `ObjectId` will be generated for the value of the `_id` field in each output document.
105105

106106

107107
### Updating a MongoDB collection

0 commit comments

Comments
 (0)