前言
本文章以储存期货TICK数据为例,编程软件vs2022,操作系统win10 x64。
vs2022配置
mongoc配置教程
内容
本文实现的插入数据图
代码实现
#include <bson/bson.h>
#include <mongoc/mongoc.h>
#include <stdio.h>
int main(int argc,
char* argv[])
{
mongoc_client_t* client;
mongoc_collection_t* collection;
bson_error_t error;
bson_oid_t oid;
bson_t* doc;
bson_t child;
struct tm tick = {
0 };
tick.tm_year = 99; /* years are 1900-based */
tick.tm_mon = 11; /* months are 0-based */
tick.tm_mday = 7;
tick.tm_hour = 18;
tick.tm_min = 55;
tick.tm_sec = 56