Answer the question
In order to leave comments, you need to log in
How to add data to MongoDB in php?
I'm familiar with MongoDB. I found examples of working in php with Mongo, I'm trying to write a method for adding data to the database:
//класс для работы с MongoDB
class Database {
public function save($data){
$m = new MongoClient();
$m -> selectDB(DB_NAME) -> selectCollection(COLLECTION_NAME);
$m -> insert($data);
$m -> close();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question