Comments (3)
Hi @gjsmith66!
Let me explain a little bit how search criteria is processed.
If some criteria field is null
, undefined
, ""
, 0
- the data doesn't filtered by this field at all. Other words, this criteria is ignored. In this case search criteria will be transformed to
{
dataCenter: [DataCenter.US_EAST_STERLING],
groupId: 'ourgroupid'
}
The same behavior in #197
from clc-node-sdk.
I understand, and saw in the code where this is happening. However...
- This is behavior is not documented
- I do not know of any other system that I have ever used where those values would result in essentially creating a wildcard that matches everything. If you did a Select in SQL and set a value to 0 or "", it does not match all. And, when you understand that you are indeed creating a wildcard, you see how dangerous this behavior is.
- What is the most common Javascript error? That's right, passing an undefined variable. So, when testing (and remember CL has no Sandbox that I know of), you are creating the perfect storm for deleting all your servers...
- I see no justification for handling this way. And if this is the behavior everywhere, are there cases where you ARE preventing a valid match on '' or 0? What if you wanted to find descriptions = ''? That would match all, not what someone would expect. I can't think of a field that you would want to search for a 0, but my guess is that there are some. And guess what? What happens is the exact opposite of what you would want.
My belief is that you should error on this condition, or treat the value literally and try to match on a '' or 0. A null or undefined are clearly cause to fail.
Please let me know if you have any questions.
Thanks!
from clc-node-sdk.
@gjsmith66 Thank you for bringing our attention to this issue.
Documentation will be updated soon.
So now if you specify null
or undefined
as criteria property - it will search by this value, not omit it as was implemented before.
I'm not sure that SDK should throw errors if user pass null.
Please update SDK to the latest one (1.1.4) and check, that all issues were fixed.
Regards,
Alex
from clc-node-sdk.
Related Issues (20)
- Autoscale Policies Management
- Firewall Policies
- Claim / Release / Update Networks
- Open sources of clc-node-sdk HOT 2
- Publish CLC Node SDK to npm
- Move autoscale policy field to Machine subconfig at Create Server Command
- Add support of autoscale policy to modify command
- Add support of anti-affinity policy to modify command
- Implement possibilities to create load balancer with multiple pools by single command
- Implement possibilities to modify load balancer with multiple pools by single command
- Add support of alert and autoscale policies to define infrastructure command
- Describe v1.1.0 new features in wiki
- Release version 1.1.0 of CLC Node SDK
- Feature Suggestion: CLC shell? HOT 1
- Add custom User Agent header
- Release version 1.1.1 to npm
- Unhanded rejections when Cloning HOT 2
- Major Issue with Server Selection
- Time issues between UTC and EST 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 clc-node-sdk.