Comments (15)
@mAiNiNfEcTiOn no problem, congrats for your new child! And thanks for the PR. I made some comment there, I will now run the tests
from gstore-node.
@jainanshul @machinshin it has just been released in the last version. Thanks again to @mAiNiNfEcTiOn for the feature 👍
from gstore-node.
Thank you both for working on it. Will test and provide feedback shortly.
from gstore-node.
@mAiNiNfEcTiOn congratulations to you & your partner on your new baby! :)
Totally understand that fatherhood has to take priority, and thanks for getting back to this PR! :)
@sebelga awesome, thank you!
from gstore-node.
Hi, no it does not but it would be a good feature to add. I put it on my todo list :)
from gstore-node.
Actually this brings the opportunity to consider custom validation functions :)
Doing something like:
// Private function, receives the value to be validated. Other args defined in the Schema.
const myCustomFunction = (value, arg1, arg2, arg3, arg4, ..., argN) => {
const isValid = ['success_rate', 'failure_rate'].every(key => (key in value) && (typeof value[key] === 'number'));
return isValid;
};
// Model/Schema definition
const Model = gstore.model('MyModel', {
results: {
type: 'object',
validate: {
rule: myCustomFunction,
args: ['arg1', 'arg2', 'arg3', 'arg4', ..., 'argN'],
}
}
});
Also, when considering the case above, exposing validator.js
and the schema definitions to the custom validation function would allow the devs to re-use validation definitions :)
(Just my 2 cent)
from gstore-node.
@mAiNiNfEcTiOn I think that's a great idea. If you want to give it a try go ahead. I am right now in the middle of changing both job + city so I won't have much time these coming weeks to work on gstore. All the help very much appreciated! :)
from gstore-node.
@sebelga ok, will dedicate some time to it tomorrow. 👍
Success for your new adventure!
from gstore-node.
thanks @mAiNiNfEcTiOn !
from gstore-node.
Hi @jainanshul and @sebelga , sorry for no input on this one. Got hit by a storm of stuff to do at work.
Will try to find some time during the next week to do this implementation.
from gstore-node.
No rush, thanks for the quick update.
from gstore-node.
Hi @mAiNiNfEcTiOn No problem, I understand perfectly I am in the same situation! :) Hopefully in a week or so I should be able to work again on gstore-node. Thanks for the update!
from gstore-node.
@mAiNiNfEcTiOn after some time working on the refactor of all the responses in the library I am back on looking at new feature :) Probably the custom function validation would be the next one. I guess that you are still quiet busy, should I have a look at it based on your suggestion?
from gstore-node.
hi @sebelga,
I would also love to have this embedded validation feature.
from gstore-node.
@machinshin and @sebelga sorry about that... Became a father on the 11th of April 2017 🎉 and before didn't have much time (neither now ... but at least I came up with this PR to try to implement it)
from gstore-node.
Related Issues (20)
- query filter on nested property value. HOT 5
- tsc error: Could not find a declaration file for module 'nsql-cache' HOT 3
- could not get data filter by entity key
- Support for @google-cloud/datastore version 5 HOT 2
- Support for custom validators (AJV)
- bulk insert? HOT 2
- Cannot read property 'Symbol(KEY)' when body is null or undefined HOT 1
- Typescript Compile Error HOT 2
- Support for HABTM
- Could not find gstore instance with id "${id}" HOT 2
- How to validate a value agains another property? HOT 1
- Datastore Key type error when using cache HOT 7
- Update method doesn't clear cache HOT 6
- Add Transaction support to `findOne` option HOT 1
- Support filtering for a missing optional property. HOT 1
- New query operators HOT 1
- @google-cloud/datastore version 7 support HOT 1
- could not get data filter by entity key HOT 1
- Migrate Travis CI builds to Circle CI
- Gstore node 7.2.8 TypeError: OptionalDataloader is not a constructor
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 gstore-node.