mongodb/mongo — pull request #336 by nleite (2012-12-09 22:05:08+00:00)
Title: $split function

Aggregation framework is missing a $split string function. The result of a split operation over a string should be an array with the split result and should operate. A bit like jira https://jira.mongodb.org/browse/SERVER-6773 but with a slight difference where you can set the pattern on which to split the string on.

The overall operation should be as follows:

db.collection.aggregate( {$project: { splited:{ $split: [ "string to be splited", "pattern" } } }
The string to be splited could be a document field as weel as the spliting pattern.
db.collection.aggregate( {$project: { splited:{ $split: [ "$field1", "$field2" } } }