Skip to content

Commit e10a339

Browse files
committed
Merge commit '0454966c021aa1737c9680aceef7e2ba26952fe3' into merge
* commit '0454966c021aa1737c9680aceef7e2ba26952fe3': do not lock while writing to a socket (#52) (#54) readme: credit @bozaro and @idy (#53) Improve cursorData struct unmarshaling speed (#49) readme: credit @bozaro (#47) Fix GetBSON() method usage (#40) readme: credit @feliixx (#46) fix golint, go vet and gofmt warnings (#44) readme: add missing features / credit bson.Unmarshal returns time in UTC (#42) Introduce constants for BSON element types (#41) Test against MongoDB 3.4.x (#35) Add collation option to collection.Create() (#37) Don't panic on indexed int64 fields (#23) readme: credit @feliixx in the README (#36) add method CreateView() (#33) Update README to add appName (#32) send metadata during handshake (#28) readme: credit @feliixx for #25 (#26) add DropAllIndexes() method (#25) # Conflicts: # README.md # bson/decode.go
2 parents 8d9e210 + 0454966 commit e10a339

File tree

5 files changed

+297
-200
lines changed

5 files changed

+297
-200
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Further PR's (with tests) are welcome, but please maintain backwards compatibili
3030
* Consistently unmarshal time.Time values as UTC ([details](https://github.com/globalsign/mgo/pull/42))
3131
* Enforces best practise coding guidelines ([details](https://github.com/globalsign/mgo/pull/44))
3232
* GetBSON correctly handles structs with both fields and pointers ([details](https://github.com/globalsign/mgo/pull/40))
33+
* Improved bson.Raw unmarshalling performance ([details](https://github.com/globalsign/mgo/pull/49))
34+
* Minimise socket connection timeouts due to excessive locking ([details](https://github.com/globalsign/mgo/pull/52))
3335

3436
---
3537

@@ -42,6 +44,7 @@ Further PR's (with tests) are welcome, but please maintain backwards compatibili
4244
* @eaglerayp
4345
* @feliixx
4446
* @fmpwizard
47+
* @idy
4548
* @jameinel
4649
* @gazoon
4750
* @mapete94

bson/bson_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ func testUnmarshal(c *C, data string, obj interface{}) {
8282
err := bson.Unmarshal([]byte(data), zero)
8383
c.Assert(err, IsNil)
8484
c.Assert(zero, DeepEquals, obj)
85+
86+
testUnmarshalRawElements(c, []byte(data))
87+
}
88+
89+
func testUnmarshalRawElements(c *C, data []byte) {
90+
elems := []bson.RawDocElem{}
91+
err := bson.Unmarshal(data, &elems)
92+
c.Assert(err, IsNil)
93+
for _, elem := range elems {
94+
if elem.Value.Kind == bson.ElementDocument || elem.Value.Kind == bson.ElementArray {
95+
testUnmarshalRawElements(c, elem.Value.Data)
96+
}
97+
}
8598
}
8699

87100
type testItemType struct {

0 commit comments

Comments
 (0)