DocumentReferences testing can fail if field is boolean #94

eutheria opened this Issue Nov 14, 2012 · 0 comments


None yet

1 participant


When using DocumentReferences the generated view tests for a boolean field to determine the document type

for example:

private Boolean moduleEnabled;
private String moduleParent;

@DocumentReferences(fetch = FetchType.LAZY, descendingSortOrder = true, orderBy = "_id", backReference = "moduleParent")
    private Set modules;


    public List findByModuleParent(String moduleParent) {
        return queryView("by_moduleParent", moduleParent);

this generated:

function(doc) { if(doc.moduleEnabled && doc.moduleParent) { emit([doc.moduleParent, 'modules', doc._id], null); } }

this test fails with doc.moduleEnabled set to false, I believe it would be a good idea if a custom document validator could be set?

Thanks for such a good library!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment