Comments (6)
I will look into adding support in gtm. For now could you use something like https://github.com/mitchellh/mapstructure?
from gtm.
Yeah I definitely could do that but like I said I don’t like the idea of having multiple ways to unmarshal data. I think I might just make a fork and stick the raw data in there and unmarshal that with the bson package.
The approach I mention above seems inelegant which is why I opened a ticket instead of a PR. I thought you might have a more elegant approach. I haven’t spent a lot of time looking at the code so if I get the chance and think of an nice way to handle it I’ll post it here.
from gtm.
Took a stab at this in a feature branch. Seems to work ok while keeping backwards compatibility. You set a new function in the options under Unmarshal
that gets passed a namespace and a bson.Raw
. Based on that you can unmarshal into whatever struct you want. Then the result should be in a new field on the op named Doc
. Let me know if you notice any problems.
from gtm.
Yes that should work for my purposes. Thank you!
from gtm.
No problem. I'd like to get this merged into trunk but I need to make sure I didn't introduce any regressions. I depend on this project in a couple others.
from gtm.
@sfreiberg this has now been merged into master. Please let me know if you encounter any problems.
from gtm.
Related Issues (20)
- Delete
- Multithread direct reads HOT 14
- What to do when ctx.ErrC channel provides an error? HOT 1
- License? HOT 1
- add some tests HOT 1
- Add semver tags HOT 5
- if i want resume-from-timestamp ,How should I configure it? HOT 2
- how to use gtm to sync to a mongo primary HOT 21
- Error importing v2.0.6 with new official mongo golang package HOT 4
- what’s the namespace ? HOT 1
- What is the difference between Op.Data and Op.Doc ? HOT 1
- Limit object reads to specific databases/collections HOT 2
- unset slice occur HOT 3
- column order problem HOT 1
- how to drop doc in es by custom id
- Possible key collision across namespaces
- Implement fanning out to multiple go routines with explicit ordering semantics
- Only default BufferDuration if zero
- Missing op.Data when alterations to same ns + id happen within same Timestamp Epoch second HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtm.