[
Date Prev ][
Date Next ][
Thread Prev ][
Thread Next ][
Date Index ][
Thread Index ]
[
List Home ]
Re: [jnosql-dev] [nosql-dev] mongodb $elemMatch jnosql query equivalent
  
Hi Otavio,
    Sorry for the very long delay, I had a deadline and couldn't test
      snapshot as I stuck to b5.org .eclipse .jnosql .mapping.*, 
    I hesitate to put
        "non-standard" annotations to the API... 
    Kind regards,
    Dmitry
    
    On 5/18/2023 11:19 AM, Otavio Santana
      wrote:
    
      
      
        Hey Dmitry, how are you?
        
        Could you test with the latest version, 1.0.0-SNAPSHOT?
        
        
        
        It was an injection issue; I've created a new problem; for
          me, it is an excellent opportunity to increase our integration
          test by database modules.
         
        
       
      
        
        
          
            Hi Otavio,
            When I inject MongoDBTemplate, it is injected without
              initialization (with no-arguments constructor).
            IMHO there is a lack of DefaultMongoDBTemplateProducer
              similar to the junit test.
            Best,
            Dmitry
            P.S. Here is what works for me:
            -------------------------------------------------------------------------------------------------------------
            public class MongoDBTemplateProducer {
            On 5/17/2023 6:52 PM, Otavio Santana wrote:
            
              Hey Dmitry, it should be hidden.
                You should inject the `MongoDBTemplate`.
                
                Please, take a look at this sample:
                
                
                
                
              
                
                
                  
                    Hi again,
                    There is a problem with  DefaultMongoDBTemplate
                      as
                    
                      @Inject 
MongoDBTemplate template; 
                    injects uninitialized DefaultMongoDBTemplate.
                    
The class is protected:https://github.com/eclipse/jnosql-extensions/blob/1.0.0-b5/jnosql-mongodb-extension/src/main/java/org/eclipse/jnosql/mapping/mongodb/DefaultMongoDBTemplate.java 
                    So the only way to use it - copy to my own
                      project.
                    Cheers,
                    Dmitry
                    P.S. The unit test works, because it is in the
                      same package. 
                    On 5/13/2023 8:54 AM, Dmitry Repchevsky via
                      nosql-dev wrote:
                    
                      Great!
                      Thank you, I used DocumentTemplate and was
                        thinking about Criteria extension API, but
                        direct query is a quick and good fix.
                      Thank you again,
                      Dmitry
                      On 5/13/2023 8:44 AM, Otavio Santana wrote:
                      
                        
                          
                            Hey Dmitry,
                              how are you?
                            You can use
                              the Filter directly if you use the MongoDBTemplate,
                              you can check the MongoDB
                                readme .
                            @Inject 
MongoDBTemplate template;
...
Bson filter = eq("name" , "Poliana" );
Stream<Person> stream = template.select(Person.class , filter);
 
                         
                        
                          
                          
                            Hey Dmitry, how are you?
                              
                              I hope that you are doing well.
                              
                              I've included the JNoSQL discussion
                                because what we can do is create a
                                MongoDB extension to work with it.
                              Please, let me know your thoughts.
                            
                              
                              
                                
                                  Hello,
                                  Is there any possibility to query
                                    elements in the array via jnosql
                                    query?
                                  I have (an example) data like:
                                  {
                                      "measures": [ 
                                  The mongodb query for this would
                                    look like:
                                  The only query I found to do in
                                    jnosql is something like:measures.id 
                                      = "weight" and measures.value =
                                      180
                                  Which is wrong as it found
                                      the person object that match.
                                  Cheers,
                                  Dmitry
                                  
                                  
                                    
                                  
 
_______________________________________________nosql-dev@xxxxxxxxxxx https://www.eclipse.org/mailman/listinfo/nosql-dev  
                             
                            
                            --   
                         
                        
                        --   
                      _______________________________________________
nosql-dev mailing list
nosql-dev@xxxxxxxxxxx 
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/nosql-dev 
 
                     
                   
                  _______________________________________________nosql-dev@xxxxxxxxxxx https://www.eclipse.org/mailman/listinfo/nosql-dev  
               
              
              --   
           
         
       
      
      --