object BSONObjectID
BSONObjectID utilities
- Alphabetic
- By Inheritance
- BSONObjectID
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fromTime(timeMillis: Long, fillOnlyTimestamp: Boolean = false): BSONObjectID
Generates a new BSON ObjectID from the given timestamp in milliseconds.
Generates a new BSON ObjectID from the given timestamp in milliseconds.
The included timestamp is the number of seconds since epoch, so a BSONObjectID time part has only a precision up to the second.
To get a reasonably unique ID, you _must_ set
onlyTimestamp
to false.Crafting an ID from a timestamp with
fillOnlyTimestamp
set to true is helpful for range queries; e.g if you want of find documents an_id
field which timestamp part is greater than or lesser than the one of another id.If you do not intend to use the produced BSONObjectID for range queries, then you'd rather use the
generate
method instead.- fillOnlyTimestamp
if true, the returned BSONObjectID will only have the timestamp bytes set; the other will be set to zero.
-
def
generate(): BSONObjectID
Generates a new BSON ObjectID using the current time as seed.
Generates a new BSON ObjectID using the current time as seed.
- See also
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
parse(bytes: Array[Byte]): Try[BSONObjectID]
Tries to make a BSON ObjectId from a binary representation.
-
def
parse(id: String): Try[BSONObjectID]
Tries to make a BSON ObjectId from a hexadecimal string representation.
-
def
pretty(oid: BSONObjectID): String
Returns the string representation for the given BSONObjectID.
Returns the string representation for the given BSONObjectID.
- Annotations
- @inline()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unapply(that: Any): Option[Array[Byte]]
Extracts the bytes if
that
's a BSONObjectID. -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()