Skip to content

Commit

Permalink
Revert "Support mode, db, and uniqueKey for aggregation $out stage"
Browse files Browse the repository at this point in the history
This reverts commit f936949.
SCALA-473
  • Loading branch information
rozza committed Feb 6, 2019
1 parent 8168851 commit 960b6db
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 30 deletions.
12 changes: 1 addition & 11 deletions driver/src/main/scala/org/mongodb/scala/model/Aggregates.scala
Original file line number Diff line number Diff line change
Expand Up @@ -339,21 +339,11 @@ object Aggregates {
def unwind(fieldName: String, unwindOptions: UnwindOptions): Bson = JAggregates.unwind(fieldName, unwindOptions)

/**
* Creates a `\$out` pipeline stage that writes to the collection with the specified name
* Creates a `\$out` pipeline stage for the specified filter
*
* @param collectionName the collection name
* @return the `\$out` pipeline stage
* @see [[http://docs.mongodb.org/manual/reference/operator/aggregation/out/ \$out]]
*/
def out(collectionName: String): Bson = JAggregates.out(collectionName)

/**
* Creates a `\$out` pipeline stage that writes to the collection with the specified name, using the specified options
*
* @param collectionName the collection name
* @param options the options
* @return the `\$out` pipeline stage
* @see [[http://docs.mongodb.org/manual/reference/operator/aggregation/out/ \$out]]
*/
def out(collectionName: String, options: AggregateOutStageOptions): Bson = JAggregates.out(collectionName, options)
}
16 changes: 0 additions & 16 deletions driver/src/main/scala/org/mongodb/scala/model/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,6 @@ package object model {
def apply(): BucketOptions = new com.mongodb.client.model.BucketOptions()
}

/**
* The options for a \$out aggregation pipeline stage
*
* @since 2.6
*/
type AggregateOutStageOptions = com.mongodb.client.model.AggregateOutStageOptions

/**
* The options for a \$out aggregation pipeline stage
*
* @since 2.6
*/
object AggregateOutStageOptions {
def apply(): AggregateOutStageOptions = new com.mongodb.client.model.AggregateOutStageOptions()
}

/**
* Granularity values for automatic bucketing.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ class AggregatesSpec extends FlatSpec with Matchers {

it should "render $out" in {
toBson(out("authors")) should equal(Document("""{ $out : "authors" }"""))
toBson(out("authors", AggregateOutStageOptions().databaseName("foo"))) should equal(
Document("""{ $out : {mode: "replaceCollection", to: "authors", db: "foo" } }""")
)
}

it should "render $group" in {
Expand Down

0 comments on commit 960b6db

Please sign in to comment.