我有嵌入式文档更新的问题.
我定义的架构:
var Talk = new Schema({
title: {
type: String,
required: true
},
content: {
type: String,
required: true
},
date: {
type: Date,
required: true
},
comments: {
type: [Comments],
required: false
},
vote: {
type: [VoteOptions],
required: false
},
});
var VoteOptions = new Schema({
option: {
type: String,
required: true
},
count: {
type: Number,
required: false
}
});
Run Code Online (Sandbox Code Playgroud)
现在我想vote.count++用给定的Talkid和VoteOptionid 更新.我有以下功能来完成这项工作:
function makeVote(req, res) {
Talk.findOne(req.params.id, function(err, talk) {
for …Run Code Online (Sandbox Code Playgroud) 我想读一个NFC标签UID,标签没有任何ndef消息或任何东西(空),只是UID.在Android上很容易做到,但Phonegap开发速度更快,所以我想知道是否有可能使用phonegap,可能使用phonegap-nfc插件.