You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to save a mongoose document with its save method. I saw in js.npm.mongoose.Model.hx:
@:native("Model")
extern class TModel<T>
extends Document<T>
implements npm.Package.RequireNamespace<"mongoose","*">
{
...
public function save( fn : Callback<TModel<T>> ) : Void;
...
}
So I tried:
class MyModel extends Model<MyModelData>{}
class MyModelDOA{
public function clone(mod: MyModel, callback: Callback<MyModel>):Void
{
mod.save(callback);
}
}
But I get Function 'save' requires no arguments. The weird thing is that I can use any function on the model and it didn't trigger any compilation errors (I tried mod.hjdzjhuhef() and it compiled), like it's a Dynamic.
Is there an interference with another save function ?
The text was updated successfully, but these errors were encountered:
Sorry for the delay, I've been working on other stuff ;)
I believe you may want to extend js.npm.mongoose.macro.Model and not just js.npm.mongoose.Model.
Also, both extend Document, which is (for now) Dynamic, so it makes sense that you can set any value to it.
If it still doesn't work, I'd be interested in reviewing your code to have more clues regarding the context of this error.
Hi,
I'm trying to save a mongoose document with its save method. I saw in
js.npm.mongoose.Model.hx
:So I tried:
But I get
Function 'save' requires no arguments
. The weird thing is that I can use any function on the model and it didn't trigger any compilation errors (I triedmod.hjdzjhuhef()
and it compiled), like it's a Dynamic.Is there an interference with another save function ?
The text was updated successfully, but these errors were encountered: