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

CSHARP-2349: Support empty field names, since MongoDB supports them #334

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,12 @@ public bool IsValidElementName(string elementName)
{
Ensure.IsNotNull(elementName, nameof(elementName));

if (elementName.Length == 0)
{
// the server seems to allow empty element names, but in 1.x we did not
return false;
}

if (elementName.IndexOf('.') != -1)
{
return false;
}

if (elementName[0] == '$' && !__exceptions.Contains(elementName))
if (elementName.Length != 0 && elementName[0] == '$' && !__exceptions.Contains(elementName))
{
return false;
}
Expand Down