Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
8

855

@855
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Filter data before lookup(join) two collections in mongodb
    8 855

    I'm writing a function which will join two collections and two filters for each.

    public class Teacher
    {
    public string Id{ get; set; }
    public string Name{ get; set; }
    public string TeacherFilter{ get; set; }
    ...
    }

    public class Student
    {
    public string Id{ get; set; }
    public string Name{ get; set; }
    public string StudentFilter{ get; set; }
    public string TeacherId{ get; set; }
    ...
    }

    public class TeacherStudents
    {
    public string Id{ get; set; } -- from teacher
    public string Name{ get; set; } -- from teacher
    public IEnumerable<Student> Students{get;set;}
    }

    public class TeacherStudents
    {
    public string Id{ get; set; } -- from teacher
    public string Name{ get; set; } -- from teacher
    public IEnumerable<Student> Student{get;set;}
    }

    public class TeacherStudent
    {
    public string Id{ get; set; } -- from teacher
    public string Name{ get; set; } -- from teacher
    ...
    public Student Student{get;set;}
    }

    Get(string TeacherFilter,string StudentFilter).

    Here is how i implement it

    var query = teacherCollection.Aggregate().Match(x => x.TeacherFilter== TeacherFilter); //filter teach
    var query1 = query
    .Lookup<Teacher, Student, TeacherStudent>(studentCollection, t => t.Id, s => s.TeacherId, l => l.Student)
    .Unwind(x => x.Student, new AggregateUnwindOptions<TeacherStudent>())
    .Match(x => x.StudentFilter== StudentFilter) //filter student

    For the teacher collection, useless data has been filter out before lookup which will reduce the data size when doing the lookup(join). But for the student collection, the match stage is appended after the lookup. so does all the data from student will join with teacher behind the scenes? is it possible to filter out some student data before the lookup?

    The Lounge database mongodb regex question

  • Filter data before lookup(join) two collections in mongodb
    8 855

    why no one answer it?

    Database database mongodb regex question

  • Filter data before lookup(join) two collections in mongodb
    8 855

    I'm writing a function which will join two collections and two filters for each.

    public class Teacher
    {
    public string Id{ get; set; }
    public string Name{ get; set; }
    public string TeacherFilter{ get; set; }
    ...
    }

    public class Student
    {
    public string Id{ get; set; }
    public string Name{ get; set; }
    public string StudentFilter{ get; set; }
    public string TeacherId{ get; set; }
    ...
    }

    public class TeacherStudents
    {
    public string Id{ get; set; } -- from teacher
    public string Name{ get; set; } -- from teacher
    public IEnumerable<Student> Students{get;set;}
    }

    public class TeacherStudents
    {
    public string Id{ get; set; } -- from teacher
    public string Name{ get; set; } -- from teacher
    public IEnumerable<Student> Student{get;set;}
    }

    public class TeacherStudent
    {
    public string Id{ get; set; } -- from teacher
    public string Name{ get; set; } -- from teacher
    ...
    public Student Student{get;set;}
    }

    Get(string TeacherFilter,string StudentFilter).

    Here is how i implement it

    var query = teacherCollection.Aggregate().Match(x => x.TeacherFilter== TeacherFilter); //filter teach
    var query1 = query
    .Lookup<Teacher, Student, TeacherStudent>(studentCollection, t => t.Id, s => s.TeacherId, l => l.Student)
    .Unwind(x => x.Student, new AggregateUnwindOptions<TeacherStudent>())
    .Match(x => x.StudentFilter== StudentFilter) //filter student

    For the teacher collection, useless data has been filter out which will reduce the data size when doing the lookup(join). But for the student collection, the match stage is appended after the lookup. so does all the data from student will join with teacher behind the scenes? is it possible to filter out some student data before the lookup?

    Database database mongodb regex question

  • cross-domain issue
    8 855

    i get cookies using fiddler, how to set the cookies in code

    C# php com json help tutorial

  • cross-domain issue
    8 855

    I want to request http://odds.500.com/fenxi/inc/daxiaoajax.php?fid=368623&id=710&t=1366372025518[^], this page will response a json text. But as cross-domain issue, i get nothing. how to deal with this? i use WebRequest myWebRequest = WebRequest.Create(url);to get the response.

    C# php com json help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups