0
I’m developing a system with PHP Laravel
+ MongoDB
.
The login and password part will be modeled using MySQL
and use MongoDB
to make a quiz.
I was thinking of putting together a Schema
in MongoDB
of that kind:
var quiz = [{
user_id: 1, //Auth::id() | O id do user vai vir do Auth do php laravel
name: "Quiz 1",
question: [{
title: 'question1',
type: 'radio',
elements: ['radio1', 'radio2', 'radio3', 'radio4'],
correct: ['radio1'],
resposta: ['radio3'] //errou
},{
title: 'question 2',
type: 'checkbox',
elements: ['checkbox1', 'checkbox2', 'checkbox3', 'checkbox4'],
correct: ['checkbox1', 'checkbox2'],
resposta: ['checkbox1','checkbox2'] //acertou
}]
}];
It is commonly, in the projects, to make a hybrid deployment of two banks?
I would do everything in Mysql, but nothing prevents such a process. If you don’t have as much knowledge in Mongodb then don’t use ...
– novic
What is your reason for using Mongodb instead of Mysql?
– Gabriel Rodrigues
@Gabrielrodrigues I think it’s easier to do everything in one Schema than to create several tables, make the Foreign Keys and later the joins.
– Denali