Skip to Content
Node与Express开发(第2版)
book

Node与Express开发(第2版)

by Ethan Brown
June 2021
Intermediate to advanced
290 pages
9h 21m
Chinese
Posts & Telecom Press
Content preview from Node与Express开发(第2版)
持久化
|
131
price: 99.95,
tags: ['day trip', 'hood river', 'sailing', 'windsurfing', 'breweries'],
inSeason: true,
maximumGuests: 16,
available: true,
packagesSold: 0,
}
]
// 如果指定了available,那么只返回匹配的度假产品
if (options.available !== undefined)
return vacations.filter(({ available }) => available === options.available)
return vacations
},
addVacationInSeasonListener: async (email, sku) => {
// 我们就认为它做完了。
// 因为这是一个异步函数,所以会自动返回一个新的promise,
// 这个promise会被解析为undefined
},
}
从应用来看,数据库应该怎样实现?对此,上面的接口给出了一个预期。我们需要做的就
是让数据库符合这个接口。请注意,我们引入了度假产品“可用”的概念,这样是为了便
于临时停用度假产品,而不必从数据库删除该产品。举个例子,一个提供住宿加早餐的小
旅馆联系你说,他们因装修需要停业几个月,因此需要停用他们的度假产品。把“可用”
跟“上市”的概念区分开是因为我们可能会希望在网站上列出未上市的度假产品,毕竟人 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

面向对象的思考过程(原书第5版)

面向对象的思考过程(原书第5版)

马特 魏斯费尔德
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua

Publisher Resources

ISBN: 9787115565099