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

findOne with fields causes insert on optional field #718

Open
BramVerb opened this issue Aug 21, 2020 · 1 comment
Open

findOne with fields causes insert on optional field #718

BramVerb opened this issue Aug 21, 2020 · 1 comment

Comments

@BramVerb
Copy link

On the client side I do a Books.findOne({}, {fields: {anOptionalField:1}})
The anOptionalField in this my case is another object created using Class.create({...})

Then the I get the following error:

Error invoking Method '/Astronomy/insert' errorClass {
details: undefined,
error: 403,
errorType: "Meteor.Error",
isClientSafe: true,
message: "Inserting from the client is not allowed [403]",
reason: "Inserting from the client is not allowed"
}

And it does not throw the error when I use the following query:
Books.findOne({}, {fields: {anOptionalField:1}}, defaults: false)

To me it seems like a bug that a findOne query causes the client to try and insert something into the collection.

@lukejagodzinski
Copy link
Member

You need to create reproduction repository for me to test it. I don't think it's Astronomy's problem. You probably have some error in your code.

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

2 participants