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

GridFile and custom Id #45

Open
mstijak opened this issue Oct 18, 2010 · 0 comments
Open

GridFile and custom Id #45

mstijak opened this issue Oct 18, 2010 · 0 comments

Comments

@mstijak
Copy link

mstijak commented Oct 18, 2010

If following code is used to create GridFile resulting file will be invalid.

var file = new GridFile()
{
Content = content,
Id = Norm.ObjectId.NewObjectId(),
UploadDate = DateTime.Now,
FileName = filename,
ContentType = contentType
};
mongoDb.Files().Save(file);

Reason is that when Content is set autogenerated Id is used. Then Id is changed which result that file and chunks are not related anymore.... Id change should be forbidden after content is set, or all chunks should be updated to use new Id.

It's not a big issue, but it took me a few hours and forced me to debug norm code :)
BTW, great lib ...

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