无论如何,在 Deno 中是否可以使用模式?
我正在尝试使用 Deno 和 MongoDB 存储和使用类似于以下结构的数据。
[
{
id: "AAPL",
stockData: [
{ date: 1634601600, summary: [Object] },
{ date: 1634688000, summary: [Object] },
{ date: 1634774400, summary: [Object] },
{ date: 1634860800, summary: [Object] }
]
},
{
id: "MSFT",
stockData: [
{ date: 1634601600, summary: [Object] },
{ date: 1634688000, summary: [Object] }
]
}
]
[Object]
类似于:
{
date: "1646956800",
summary: { open: 287.96, high: 289.51, low: 279.43, close: 280.07, volume: 27209330 }
}
由于 Deno 是新的,而且我知道目前与 Deno 和 Mongoose 不兼容,我有一些问题:
- Deno 是否有替代 Mongoose 的替代方案或更好的方案使用模式的方法?
- 如果我想做一个大项目,我现在应该停止使用 Deno 并返回使用 NodeJS 吗?
- 我可以将 Deno 代码转换为 NodeJS-TypeScript 代码吗?或者最好用 JavaScript 重写它?
我是一名平庸的程序员,也是网络开发领域的新手。我正在尝试编写我的第一个真实/商业项目,我不想因为缺乏 Deno 能力而陷入困境,也想使用最新的技术,并且不想在我之后用新技术重写项目完成了它。所以我不知道我应该保留我的项目使用 Deno 还是将其重写为 NodeJS 并忘记 Deno?
I am trying to store and work with a similar to following structure data using Deno and MongoDB.
[
{
id: "AAPL",
stockData: [
{ date: 1634601600, summary: [Object] },
{ date: 1634688000, summary: [Object] },
{ date: 1634774400, summary: [Object] },
{ date: 1634860800, summary: [Object] }
]
},
{
id: "MSFT",
stockData: [
{ date: 1634601600, summary: [Object] },
{ date: 1634688000, summary: [Object] }
]
}
]
And [Object]
is something like:
{
date: "1646956800",
summary: { open: 287.96, high: 289.51, low: 279.43, close: 280.07, volume: 27209330 }
}
As Deno is new and I know there is no compatibility with Deno and Mongoose at the moment, I have some questions:
- Is there any alternative to Mongoose for Deno or any better way to work with schemas?
- If I want to do a big project should I stop working with Deno and return to using NodeJS at the moment?
- Can I convert my Deno code to NodeJS-TypeScript code or it is better to rewrite it in JavaScript?
I am a mediocre programmer and new in web development. I am trying to write my first real/commercial project and I don't want to get stuck because of lack of abilities in Deno, also want to use the latest technology and don't want to rewrite the project with a new technology after I completed it. So I don't know should I keep my project using Deno or rewrite it to NodeJS and forget the Deno?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Deno 的 mongoDriver:https://deno.land/x/mongo。
它不是 deno.land/x 上唯一可用的,您可以从 deno.land 网站进行搜索。
You can use the mongoDriver for Deno : https://deno.land/x/mongo.
It is not the only one available on deno.land/x, you can make a search from deno.land website.