-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decode BSON documents correctly in API responses (#32)
Previously the BSON documents in the result sets were decoded as bson.D when stored in EiffelEvent.Data. This meant that the original objects turned up as slices of objects, [{"Key": "name", "Value": "foo"] instead of objects, {"name": "foo"} which obviously meant that they were no longer valid Eiffel events. We address this by deriving the EiffelEvent data type from map[string]interface{} which is the same underlying type as bson.M, the unordered map type. This made the internal/schema package more or less empty so the remaining EiffelEvent definition was moved to internal/database/drivers where the database driver interface is defined. When we implement other API endpoints we'll need to access members of the Eiffel events in the responses and there are a few different ways of doing that, but let's deal with that later. The projections of the MongoDB queries were also adjusted to omit the unwanted "_id" field. Adding eiffelevents-sdk-go and running "go mod tidy" resulted in an extra "require" section in go.mod. Not entirely sure why.
- Loading branch information
1 parent
046dad0
commit 50049d9
Showing
8 changed files
with
147 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters