私はこのような答えを定義する1つのnodejsアプリ、持っている:答えセッションとして保存_idがMongoDBで特別な使い方をしていれば?
var sessionSchema = mongoose.Schema({
name : String, // the name of the session, like 'SAM' or 'SA'
currQ : Number, // the current question being answered
state : String, // the state of the current question: new, done, asking, summarize
active : Number // 1 if active, 0 otherwise
});
として保存
var answerSchema = mongoose.Schema({
session : String, // the ID of the session
question : String, // the ID of the question
answer : Number // the selected answer (1-5)
});
を。一つの機能は、1答え-tpye変数を取得し、私は、この行が何を意味するかだ、本当に混乱しています、その後
session = reply.session._id;
を
var reply = JSON.parse(res);
を使用EJSファイルで
、。 _idが使用されても定義されていないケースはまだ多いです。
に追加されることなく利用できるようになります
を呼び出すことができますので、マングースも_idの文字列表現のidゲッターを追加あなたがあることを確認する方法ですそれを設定していないのですか? – epascarello