Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2708

What are the differences between org.bson.BsonValue and classes defined under org.bson.types

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.5.0
    • Component/s: BSON
    • Labels:
      None
    • Environment:
      mongo-java-driver-3.5.0.jar

      Hi Mongodb team,

      I'm on data analysis in java application and found that for the data(field) type there are some similar definitions,
      e.g.
      org.bson.types.BSONTimestamp
      org.bson.BsonTimestamp

      Most of fields' type on java can be matched to classes defined under org.bson.types.* but only bson timestamp is exceptional, which is matched to org.bson.BsonTimestamp.

      below is the results of <fieldValue>.getClass().getName(), which is printed by my application.
      java.lang.String
      org.bson.BsonTimestamp // never be org.bson.types.BSONTimestamp
      org.bson.types.ObjectId
      org.bson.Document
      org.bson.types.MinKey
      org.bson.BsonTimestamp
      org.bson.types.ObjectId
      org.bson.types.MaxKey
      java.lang.String
      org.bson.Document

      it shows that field type comes from both subtype of org.bson.BsonValue and org.bson.types.*

      What is the difference between them, or some duplicated definitions?

      Can you please give me help or guide?
      Thanks.

            Assignee:
            Unassigned Unassigned
            Reporter:
            8666592@qq.com jacky chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: