Skip to content

Commit

Permalink
no query operators for encode/decode fields
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Sep 2, 2019
1 parent 43b1691 commit 7a20736
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/mongoschema/query.d
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,16 @@ private string generateMembers(T)(T obj)
{
{
string name = memberName;
static if (hasUDA!((__traits(getMember, obj, memberName)), schemaName))
static if (hasUDA!(__traits(getMember, obj, memberName), schemaName))
{
static assert(getUDAs!((__traits(getMember, obj, memberName)), schemaName)
static assert(getUDAs!(__traits(getMember, obj, memberName), schemaName)
.length == 1, "Member '" ~ memberName ~ "' can only have one name!");
name = getUDAs!((__traits(getMember, obj, memberName)), schemaName)[0].name;
name = getUDAs!(__traits(getMember, obj, memberName), schemaName)[0].name;
}
ret ~= generateMember(memberName, name);

static if (!hasUDA!(__traits(getMember, obj, memberName), encode)
&& !hasUDA!(__traits(getMember, obj, memberName), decode))
ret ~= generateMember(memberName, name);
}
}
return ret;
Expand Down

0 comments on commit 7a20736

Please sign in to comment.