youngmonkeys / ezydata Goto Github PK
View Code? Open in Web Editor NEWSupports to interact to data, memory caching and database
License: Apache License 2.0
Supports to interact to data, memory caching and database
License: Apache License 2.0
Is your feature request related to a problem? Please describe.
public void SetNewPassword(Long id, String password)
{
Account account = accountRepo.findById(id);
account.setPassword(password);
accountRepo.save(account);
}
i need to save the whole account object instead of saving only the required field password
Describe the solution you'd like
there should be get some function to save only a single value by id like
saveValueById(id, "field-in-the-collection", value)
Same for a get a single value
Int/String value = getValueById(id, "field-in-the-collection")
There are a lot of usecases to need only save a single value instead of the full object. like Character stats, inventory(load a inventory Object with 100 entries rewrite a single value and write it back to db) maybe isnt good for server performance and for large Objects.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
public Account getAccountByUsername(String username)
{
return accountRepo.findByField("username", username);
}
does not match if the username in database is "Paul" and the given String username is "paul"
Describe the solution you'd like
It should be a solution or query that have a option to case-insensitive search so that String "paul" match in database with "Paul", "PAUL", "paul", "pAUl", .
e.g.
findByField("username", username, true); or findByField("username", username, false); Or some separate function to get this behaviour.
Describe alternatives you've considered
Additional context
If use this custom query with all other needed implementations:
@EzyQuery("{$query: {?0:'?1'},{_id:1, ?2:1}")
StringValue getStringFieldByValue(String field, String value, String retValue);
for now i use this to test to get the datas available if the below Error not there:
@Data
@EzyCollection
public class StringValue {
@EzyId
Long id;
String username;
}
the call looks :
StringValue value = accountService.getStringFieldByValue("email", request.getEmail(), "username");
I get this error if i call the custom query somewere. I think the major error from the list are:
readStartArray can only be called when CurrentBSONType is ARRAY, not when CurrentBSONType is DOCUMENT.
The Query should normal do this db.account.FindOne({email:'[email protected]'}, {_id:0, username:1})
returns: [ { username: 'yourusername' } ]
this query should be universal to get a string back there are two problems if i write it back to the StringValue object, this need the id but i dont need and set it _id:0 and i dont now realy if String named username:
@Data
@EzyCollection
public class StringValue {
@EzyId
Long id;
String username;
}
is there a example to get out a value from the query lets say i turn this to a String instead a StringValue object
public StringValue getStringFieldByValue(String field, String value, String retValue) {
return accountRepo.getStringFieldByValue(field, value, retValue);
}
something like:
public String getStringFieldByValue(String field, String value, String retValue) {
String value = accountRepo.getStringFieldByValue(field, value, retValue);
// how to extract the value of retValue as string from the returned query if the above error not exist enymore;
// In this example yourusername value [ { username: 'yourusername' } ]
return value:
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.