Comments (1)
Nearly one year later, I've got this problem too, digging it up I found out what it is
Once you generated the binary file, it still looks for this locals.json
file to start the connection; The simple solution was to embed it as a string in my connection file, something like this:
var localMapStr = `
{
"en-US": {
"validation.field_required": "Field '%s' is required.",
"validation.field_invalid": "Field '%s' has an invalid value.",
"validation.field_invalid_id": "Field '%s' contains an invalid object id value.",
"validation.field_minlen": "Field '%s' must be at least %v characters long.",
"validation.field_maxlen": "Field '%s' can be maximum %v characters long.",
"validation.entry_exists": "%s already exists for value '%v'.",
"validation.field_not_exclusive": "Only one of both fields can be set: '%s'' or '%s'.",
"validation.field_required_exclusive": "Field '%s' or '%s' required."
}
}
`
var localMap map[string]map[string]string
json.Unmarshal([]byte(localMapStr), &localMap)
dbConfig := &mongodm.Config{
DatabaseHosts: []string{os.Getenv("MONGODB_HOST")},
DatabaseName: os.Getenv("MONGODB_DATABASE"),
Locals: localMap["en-US"],
}
Not really the best solution out there, but this package seems a little out of date anyway
from mongodm.
Related Issues (18)
- About contributing HOT 11
- Replace unmaintained mgo dependency with community fork HOT 1
- Change license to MIT
- Virtuals and Hooks (like in mongoose)
- Put docker infos back to readme? HOT 2
- using Documentbase.Update() HOT 1
- Assigning a 1n relation
- 1n relation. saving objectId's and populating them
- Populating on .Find()
- Allow nested fields to be populated
- How to create index on model? HOT 1
- Need to add `sparse` annotation support to model field
- find by relation HOT 5
- Slices always viewed as relations HOT 3
- Getting Error does not implement DefaultValidate HOT 4
- Expanding mongodm.Config HOT 3
- mongodb3.0 SCRAM-SHA-1? 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 mongodm.