All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.mongocamp.driver.mongodb.Sort.scala Maven / Gradle / Ivy

There is a newer version: 2.8.1
Show newest version
package dev.mongocamp.driver.mongodb

import org.bson.conversions.Bson
import org.mongodb.scala.model.Sorts.{ ascending, descending, orderBy }

object Sort extends Sort

trait Sort {

  def sortByKey(key: String, sortAscending: Boolean = true): Bson =
    if (sortAscending) {
      orderBy(ascending(key))
    }
    else {
      orderBy(descending(key))
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy