Skip to content

Instantly share code, notes, and snippets.

View tabvn's full-sized avatar

Toan tabvn

  • Danang, Vietnam
View GitHub Profile
#!/bin/sh
GOOS=linux GOARCH=amd64 go build
package main
import (
"fmt"
"log"
"net/http"
)
func handleFunc(w http.ResponseWriter, r *http.Request) {

New Report Api docs

All Persons Report

const filterQuery = JSON.stringify({
  from: fromDate,
 to: toDate,
db.getCollection('person_report').aggregate([
{
$match: {
_id: {$in: [ObjectId("5995d36e61e71c54a042d859")]},
roles: {
$elemMatch: {
roleId: {$in: [ObjectId("599586c861e71c54a042d84b")]},
"production.eventDate": {$gte: ISODate("2019-01-02T17:00:00.000Z")},
"production.eventDate": {$lte: ISODate("2017-01-02T17:00:00.000Z")},
}
/* 1 */
{
"_id" : ObjectId("5c1753e5031c3203d79eecd8"),
"firstName" : "Brenna",
"lastName" : "Schaffell",
"kind" : "freelancer",
"roles" : [
{
"productionId" : ObjectId("5bfc605e031c3203d79edab9"),
"roleId" : ObjectId("5995ff2061e71c54a042d86b"),
db.getCollection('persons').aggregate([
{
$lookup: {
localField: "_id",
foreignField: "staffId",
from: "production_staff",
as: "staff_roles",
@tabvn
tabvn / b.cpp
Last active December 28, 2018 16:40
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
struct Seq
{
char c;
long long length;
const query = [
{
$lookup: {
localField: '_id',
foreignField: 'productionId',
from: 'production_lead',
as: 'production_lead'
}
},
{
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Line
{
long int a,b;
long long length;
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Line
{
long int a,b;
long long length;