Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.cybermkd.mongo.kit.MongoQuery.exist(String) #50

Open
netsafer opened this issue Sep 6, 2017 · 0 comments
Open

com.cybermkd.mongo.kit.MongoQuery.exist(String) #50

netsafer opened this issue Sep 6, 2017 · 0 comments

Comments

@netsafer
Copy link

netsafer commented Sep 6, 2017

com.cybermkd.mongo.kit.MongoQuery.exist(String) 似乎存在问题,无法做到字段过滤(我理解问题?)。
可以做如下修改

public MongoQuery exist(String key) {
        query.add(Filters.exists(key));
        return this;
    }

可以增加如下方法:

/**
     * 是否存在某个key
     * @param key
     * @param exists true 存在,false 不存在
     * @return
     */
    public MongoQuery exist(String key,boolean exists) {
    	query.add(Filters.exists(key,false));
    	return this;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant