|
16 | 16 | //
|
17 | 17 | // The driver uses different types than mgo's bson. The differences are:
|
18 | 18 | //
|
19 |
| -// 1) The driver's bson.RawValue is equivalent to mgo's bson.Raw, but uses Value instead |
20 |
| -// of Data and uses Type, which is a bsontype.Type object that wraps a byte, instead of |
21 |
| -// bson.Raw's Kind, a byte. |
| 19 | +// 1) The driver's bson.RawValue is equivalent to mgo's bson.Raw, but uses Value instead of Data and uses Type, |
| 20 | +// which is a bsontype.Type object that wraps a byte, instead of bson.Raw's Kind, a byte. |
22 | 21 | //
|
23 |
| -// 3) The driver uses primitive.ObjectID, which is a [12]byte instead of mgo's |
24 |
| -// bson.ObjectId, a string. Due to this, the zero value marshals and unmarshals differently |
25 |
| -// for Extended JSON, with the driver marshaling as `{"ID":"000000000000000000000000"}` and |
26 |
| -// mgo as `{"Id":""}`. The driver will not unmarshal {"ID":""} to a primitive.ObjectID. |
| 22 | +// 2) The driver uses primitive.ObjectID, which is a [12]byte instead of mgo's |
| 23 | +// bson.ObjectId, a string. Due to this, the zero value marshals and unmarshals differently |
| 24 | +// for Extended JSON, with the driver marshaling as {"ID":"000000000000000000000000"} and |
| 25 | +// mgo as {"Id":""}. The driver can unmarshal {"ID":""} to a primitive.ObjectID. |
27 | 26 | //
|
28 |
| -// 4) The driver's primitive.Symbol is equivalent to mgo's bson.Symbol. |
| 27 | +// 3) The driver's primitive.Symbol is equivalent to mgo's bson.Symbol. |
29 | 28 | //
|
30 |
| -// 5) The driver uses primitive.Timestamp instead of mgo's bson.MongoTimestamp. While |
31 |
| -// MongoTimestamp is an int64, primitive.Timestamp stores the time and counter as two separate |
32 |
| -// uint32 values, T and I respectively. |
| 29 | +// 4) The driver uses primitive.Timestamp instead of mgo's bson.MongoTimestamp. While |
| 30 | +// MongoTimestamp is an int64, primitive.Timestamp stores the time and counter as two separate |
| 31 | +// uint32 values, T and I respectively. |
33 | 32 | //
|
34 |
| -// 6) The driver uses primitive.MinKey and primitive.MaxKey, which are struct{}, instead |
35 |
| -// of mgo's bson.MinKey and bson.MaxKey, which are int64. |
| 33 | +// 5) The driver uses primitive.MinKey and primitive.MaxKey, which are struct{}, instead |
| 34 | +// of mgo's bson.MinKey and bson.MaxKey, which are int64. |
36 | 35 | //
|
37 |
| -// 7) The driver's primitive.Undefined is equivalent to mgo's bson.Undefined. |
| 36 | +// 6) The driver's primitive.Undefined is equivalent to mgo's bson.Undefined. |
38 | 37 | //
|
39 |
| -// 8) The driver's primitive.Binary is equivalent to mgo's bson.Binary, with variables named Subtype |
40 |
| -// and Data instead of Kind and Data. |
| 38 | +// 7) The driver's primitive.Binary is equivalent to mgo's bson.Binary, with variables named Subtype |
| 39 | +// and Data instead of Kind and Data. |
41 | 40 | //
|
42 |
| -// 9) The driver's primitive.Regex is equivalent to mgo's bson.RegEx. |
| 41 | +// 8) The driver's primitive.Regex is equivalent to mgo's bson.RegEx. |
43 | 42 | //
|
44 |
| -// 10) The driver's primitive.JavaScript is equivalent to mgo's bson.JavaScript with no |
45 |
| -// scope and primitive.CodeWithScope is equivalent to mgo's bson.JavaScript with scope. |
| 43 | +// 9) The driver's primitive.JavaScript is equivalent to mgo's bson.JavaScript with no |
| 44 | +// scope and primitive.CodeWithScope is equivalent to mgo's bson.JavaScript with scope. |
46 | 45 | //
|
47 |
| -// 11) The driver's primitive.DBPointer is equivalent to mgo's bson.DBPointer, with variables |
48 |
| -// named DB and Pointer instead of Namespace and Id. |
| 46 | +// 10) The driver's primitive.DBPointer is equivalent to mgo's bson.DBPointer, with variables |
| 47 | +// named DB and Pointer instead of Namespace and Id. |
49 | 48 | //
|
50 |
| -// 12) When implementing the Setter interface, mgocompat.ErrSetZero is equivalent to mgo's |
51 |
| -// bson.ErrSetZero. |
| 49 | +// 11) When implementing the Setter interface, mgocompat.ErrSetZero is equivalent to mgo's |
| 50 | +// bson.ErrSetZero. |
52 | 51 | //
|
53 | 52 | package mgocompat
|
0 commit comments