Compare commits

...

2 Commits

Author SHA1 Message Date
6c4af4006b v0.0.423 fix createPaginationPipeline - different primary and secondary sort keys broke mongo ??!?? - it actually only sorted by the secondary condition (ignoring the primary?)
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m32s
2024-03-24 15:25:52 +01:00
8bf3a337cf v0.0.422
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m29s
2024-03-23 20:29:46 +01:00
3 changed files with 4 additions and 8 deletions

View File

@@ -16,10 +16,6 @@ func (m JsonOpt[T]) MarshalJSON() ([]byte, error) {
return []byte("null"), nil // actually this would be undefined - but undefined is not valid JSON
}
if m.value == nil {
return []byte("null"), nil
}
return json.Marshal(m.value)
}

View File

@@ -1,5 +1,5 @@
package goext
const GoextVersion = "0.0.421"
const GoextVersion = "0.0.423"
const GoextVersionTimestamp = "2024-03-23T20:28:51+0100"
const GoextVersionTimestamp = "2024-03-24T15:25:52+0100"

View File

@@ -171,7 +171,7 @@ func createPaginationPipeline[TData any](coll *Coll[TData], token ct.CursorToken
bson.M{*fieldSecondary: bson.M{"$gt": valueSecondary}},
}})
sort = append(sort, bson.E{Key: fieldPrimary, Value: +1})
sort = append(sort, bson.E{Key: *fieldSecondary, Value: +1})
} else if *sortSecondary == ct.SortDESC {
@@ -181,7 +181,7 @@ func createPaginationPipeline[TData any](coll *Coll[TData], token ct.CursorToken
bson.M{*fieldSecondary: bson.M{"$lt": valueSecondary}},
}})
sort = append(sort, bson.E{Key: fieldPrimary, Value: -1})
sort = append(sort, bson.E{Key: *fieldSecondary, Value: -1})
}
}