0
我正在使用包meteortypescript:compiler
和meteortypescript:typescript-libs
。我想查詢一個集合了這樣的記錄:爲什麼TypeScript不讓我查詢Meteor集合?
MyCollection.findOne({email: '[email protected]', username: 'bob'});
而且我得到這個錯誤:
error TS2345: Argument of type '{ email: string; username: string; }'
is not assignable to parameter of type 'Selector'.
這是沒有意義的,因爲我可以看到該類型Selector
在我用於流星的.d.ts
文件定義爲interface Selector extends Object {}
,這應該不會產生問題。任何指針?
你是如何初始化你的收藏?例如:_Base.Collections.Channels = new Mongo.Collection(「channels」); _ –
MichelH
看起來像你使用的是明確的。你需要更新你的'meteor.d.ts'到最新的一個。請參閱[此更新](https://github.com/DanielRosenwasser/DefinitelyTyped/commit/b0c077fdd39f2b901677a5d58155f516f66f88d1)。 –
謝謝傑西。事實證明,更新到'meteortypescript:typescript-libs'修復這顯然還沒有出去,所以我手動做到了,現在它的工作。 – jpadvo